forked from Shardstone/trail-into-darkness
First commit on my server, yey!
This commit is contained in:
28
Assets/Code/Util/Editor/SceneReferenceEditor.cs
Normal file
28
Assets/Code/Util/Editor/SceneReferenceEditor.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user