public static void ShowInspector(InputStack stack) { if (stack._actionStacks != null) { UnityEditor.EditorGUILayout.Separator(); UnityEditor.EditorGUILayout.LabelField("Action Stacks"); foreach (var kvp in stack._actionStacks) { int c = 0; UnityEditor.EditorGUILayout.ObjectField(kvp.Key, kvp.Key.GetType(), false); foreach (var callback in kvp.Value) { if (callback.Target is Object) { Object obj = callback.Target as Object; UnityEditor.EditorGUILayout.ObjectField("[" + c + "] " + callback.Method.Name, obj, obj.GetType(), false); } else { UnityEditor.EditorGUILayout.LabelField("[" + c + "] " + callback.Method.Name); } ++c; } UnityEditor.EditorGUILayout.Space(); } } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); InputStack inputStack = this.target as InputStack; serializedObject.Update(); InputStack.Editor.ShowInspector(inputStack); serializedObject.ApplyModifiedProperties(); }