Search Unity

[BUG] Deleting prefab while in prefab mode breaks entire Editor

Discussion in 'Prefabs' started by MatthieuPr, Nov 12, 2018.

  1. MatthieuPr

    MatthieuPr

    Joined:
    May 4, 2017
    Posts:
    56
    So I was jumping around a new project trying to recreate from scratch our UI workflow + tools and copying and deleting prefabs around as part of that process + bringing in scripts to fix thing and after few minutes I deleted entire prefab folder while still being in prefab mode of one of those prefabs and made it unable to leave prefab mode or even quit unity normally (Force quit did solve it). If you need small project to reproduce please let me know and I'll try to make one asap ;)

    ArgumentException: Given path does not exist: 'Assets/prefabs/button-templates/ButtonCapitalStarmap.prefab'
    UnityEditor.PrefabUtility.SavePrefab (UnityEngine.GameObject inputObject, System.String path, UnityEditor.ReplacePrefabOptions replaceOptions, UnityEditor.PrefabUtility+PrefabCreationFlags creationFlags) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Prefabs/PrefabUtility.bindings.cs:188)
    UnityEditor.PrefabUtility.SaveAsPrefabAsset (UnityEngine.GameObject instanceRoot, System.String assetPath) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Prefabs/PrefabUtility.cs:1048)
    UnityEditor.Experimental.SceneManagement.PrefabStage.SavePrefab () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SceneManagement/StageManager/PrefabStage/PrefabStage.cs:334)
    UnityEditor.Experimental.SceneManagement.PrefabStage.SavePrefabWithVersionControlDialogAndRenameDialog () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SceneManagement/StageManager/PrefabStage/PrefabStage.cs:463)
    UnityEditor.Experimental.SceneManagement.PrefabStage.AutoSave () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SceneManagement/StageManager/PrefabStage/PrefabStage.cs:438)
    UnityEditor.Experimental.SceneManagement.PrefabStage.HandleAutoSave () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SceneManagement/StageManager/PrefabStage/PrefabStage.cs:288)
    UnityEditor.Experimental.SceneManagement.PrefabStage.Update () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SceneManagement/StageManager/PrefabStage/PrefabStage.cs:235)
    UnityEditor.SceneManagement.StageNavigationManager.Update () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SceneManagement/StageManager/StageNavigationManager.cs:152)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:200)

    Edit: I deleted the prefab from the project, not the scene, adding this specification to avoid misunderstandings
     
    Last edited: Nov 12, 2018
  2. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    437
    Can you please file a bug report and share the number here, this needs to be fixed, but we like to have reports to track.
     
  3. MatthieuPr

    MatthieuPr

    Joined:
    May 4, 2017
    Posts:
    56
    I will create report soon, had to dig a bit more to have 100% reproduction step but made it. I believe that the bug is related to prefab mode unable to save a prefab that has missing scripts attached to it and that cause the mentioned bug above. Will post bug # asap
     
  4. MatthieuPr

    MatthieuPr

    Joined:
    May 4, 2017
    Posts:
    56
    @SteenLund (Case 1099983) Prefab mode becomes unresponsive and doesnt allow to exit it or close editor normally
     
  5. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    437
    Thank you