using UnityEditor; using UnityEngine; namespace Nox.Core { [CustomEditor(typeof(SceneReference))] public class SceneReferenceEditor : Editor { private SceneReference sceneReference; private SerializedProperty gameState; private SerializedProperty playMode; private void OnEnable() { sceneReference = (SceneReference)target; playMode = serializedObject.FindProperty("playMode"); gameState = serializedObject.FindProperty("gameState"); } public override void OnInspectorGUI() { EditorGUILayout.PropertyField(gameState, new GUIContent("Game Active State")); if(sceneReference.gameState == GameState.GameMode) { EditorGUILayout.PropertyField(playMode, new GUIContent("Play Mode")); } serializedObject.ApplyModifiedProperties(); } } }