Skip to content

Commit

Permalink
Update ScreenEditor to work in prefab mode
Browse files Browse the repository at this point in the history
  • Loading branch information
neilsarkar committed Oct 13, 2020
1 parent 121f174 commit 468e98d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Editor/ScreenEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ static void DrawNavigator(Navigator navigator, Rect rect) {
}

static void DrawScreen(VioletScreen screen, Rect rect) {
// prefab mode
if (screen.transform.parent == null) { return; }
var navigator = screen.transform.parent.GetComponent<Navigator>();
if (navigator == null) {
Violet.LogWarning($"Unable to find Navigator for {screen.name} - make sure {screen.transform.parent.name} has a Navigator component");
Expand Down

0 comments on commit 468e98d

Please sign in to comment.