Skip to content

Commit

Permalink
Fix isEditing bool to fix packing/repacking other prefabs
Browse files Browse the repository at this point in the history
  • Loading branch information
neilsarkar committed Feb 22, 2021
1 parent 96f52b6 commit 624378e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Runtime/Navigation/VioletScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Views/View.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 624378e

Please sign in to comment.