-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84ee7cb
commit 3914710
Showing
7 changed files
with
183 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEditor; | ||
namespace Rellac.UI.Editor | ||
{ | ||
[CustomEditor(typeof(UIManager))] | ||
[CanEditMultipleObjects] | ||
public class UIManagerEditor : UnityEditor.Editor | ||
{ | ||
SerializedProperty containsLoopGroup; | ||
SerializedProperty initialPanel; | ||
SerializedProperty loopTransitionSpeed; | ||
SerializedProperty prevTransition; | ||
SerializedProperty nextTransition; | ||
SerializedProperty loopGroup; | ||
|
||
void OnEnable() | ||
{ | ||
containsLoopGroup = serializedObject.FindProperty("containsLoopGroup"); | ||
initialPanel = serializedObject.FindProperty("initialPanel"); | ||
loopTransitionSpeed = serializedObject.FindProperty("loopTransitionSpeed"); | ||
prevTransition = serializedObject.FindProperty("prevTransition"); | ||
nextTransition = serializedObject.FindProperty("nextTransition"); | ||
loopGroup = serializedObject.FindProperty("loopGroup"); | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
serializedObject.Update(); | ||
EditorGUILayout.PropertyField(containsLoopGroup); | ||
if (containsLoopGroup.boolValue) | ||
{ | ||
EditorGUILayout.PropertyField(loopTransitionSpeed); | ||
EditorGUILayout.PropertyField(prevTransition); | ||
EditorGUILayout.PropertyField(nextTransition); | ||
EditorGUILayout.PropertyField(loopGroup); | ||
} else | ||
{ | ||
EditorGUILayout.PropertyField(initialPanel); | ||
} | ||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.