Skip to content

Commit

Permalink
Move regenerate button to advanced section in navigator
Browse files Browse the repository at this point in the history
  • Loading branch information
neilsarkar committed Jul 26, 2020
1 parent 9a3a56a commit 17f7a5c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Runtime/Navigation/Navigator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,22 @@ void Update() {
RegenerateEnums();
}

[Button]
[NonSerialized, ShowInInspector] public bool Advanced;
[Title("Advanced")]
[ShowIf("Advanced"), Button, GUIColor(Violet.r, Violet.g, Violet.b)]
void Regenerate() {
Violet.Log($"Regenerating enums...");
RegenerateEnums();
Violet.Log($"Reloading screens...");
LoadScreens();
Violet.Log($"Done.");
}

void RegenerateEnums() {
var screens = GetComponentsInChildren<Screen>(true);
ScreenIdGenerator.Generate(screens);
Violet.Log($"Reloading screens...");
Violet.Log($"Done.");
}
#endif
}
Expand Down

0 comments on commit 17f7a5c

Please sign in to comment.