HKI Core
AIStateEditor.cs
Go to the documentation of this file.
1 using UnityEngine;
2 using UnityEditor;
3 using HKI.Core.Editor.Misc;
4 
5 namespace HKI.Core.AI.StateMachine.Editor
6 {
12  [CustomEditor(typeof(AIState))]
13  public class AIStateEditor : UnityEditor.Editor
14  {
15  // Private variables
16  StandardReorderableList actionsRL = null;
17  StandardReorderableList transitionsRL = null;
18 
19  // OnEnable function
20  void OnEnable()
21  {
22  actionsRL = new StandardReorderableList(serializedObject, "Actions", "Actions", false);
23  transitionsRL = new StandardReorderableList(serializedObject, "Transitions", "Transitions", false);
24  }
25 
26  // OnInspectorGUI function
27  public override void OnInspectorGUI()
28  {
29  serializedObject.Update();
30 
31  EditorGUILayout.LabelField("Actions:", EditorStyles.boldLabel);
32  actionsRL.DoLayoutList();
33  EditorGUILayout.Space();
34 
35  EditorGUILayout.LabelField("Transitions:", EditorStyles.boldLabel);
36  transitionsRL.DoLayoutList();
37 
38  serializedObject.ApplyModifiedProperties();
39  }
40  }
41 }
This is obsolete code it'll be removed later. For now it's still included for exemplary purposes for ...
Definition: AIState.cs:11
This class provides you with a better handling of ReorderableList so that ReorderableLists can be use...
This is obsolete code it'll be removed later. For now it's still included for exemplary purposes for ...