Files
trail-into-darkness/Assets/Code/Util/Editor/SceneReferenceEditor.cs
2026-03-19 18:12:07 +01:00

29 lines
903 B
C#

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();
}
}
}