From 624378eaa511a4592de2c53818a5f5b4f82f020f Mon Sep 17 00:00:00 2001 From: Neil Sarkar Date: Sun, 21 Feb 2021 23:11:25 -0500 Subject: [PATCH] Fix isEditing bool to fix packing/repacking other prefabs --- Runtime/Navigation/VioletScreen.cs | 7 +++++-- Runtime/Views/View.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Runtime/Navigation/VioletScreen.cs b/Runtime/Navigation/VioletScreen.cs index 212d4ce..dc51352 100644 --- a/Runtime/Navigation/VioletScreen.cs +++ b/Runtime/Navigation/VioletScreen.cs @@ -110,11 +110,13 @@ public void Update() { [SerializeField, HideInInspector] string prefabPath = ""; - UnityEngine.Object prefab; + [SerializeField, HideInInspector] public bool isEditing; + UnityEngine.Object prefab; + public void PackPrefab() { var path = string.IsNullOrEmpty(prefabPath) ? $"Assets/Menus/{name}.prefab" : prefabPath; - isEditing = true; + isEditing = false; PrefabUtility.SaveAsPrefabAssetAndConnect(gameObject, path, InteractionMode.AutomatedAction); } @@ -150,6 +152,7 @@ public void UnpackPrefab() { prefabPath = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot(gameObject); Violet.LogVerbose($"prefabPath is {prefabPath} for {name}"); PrefabUtility.UnpackPrefabInstance(gameObject, PrefabUnpackMode.OutermostRoot, InteractionMode.AutomatedAction); + isEditing = true; } void EditorSceneManager_sceneSaved(Scene scene) { diff --git a/Runtime/Views/View.cs b/Runtime/Views/View.cs index cc80519..6e4b3ab 100644 --- a/Runtime/Views/View.cs +++ b/Runtime/Views/View.cs @@ -111,7 +111,7 @@ void RenderWrapper(TState state, TState lastState) { #else try { RenderInternal(state, lastState); - } catch(Bail e) { + } catch(Bail) { } catch(Exception e) { UnityEngine.Debug.LogException(e); }