public override void OnGUI(GUIContent label) { if (EditorTools.RightArrowButton(label, GUILayout.Height(20f))) { ObjectWindow.ShowWindow("Edit Actions", (IList)value, SetDirty); } }
private void DrawInspector() { EditorGUI.BeginDisabledGroup(EditorApplication.isPlaying); if (EditorTools.RightArrowButton(new GUIContent("Edit Behavior", "Trigger use behavior"), GUILayout.Height(20f))) { SerializedProperty actionList = serializedObject.FindProperty("actions"); ObjectWindow.ShowWindow("Edit Behavior", serializedObject, actionList); } EditorGUI.EndDisabledGroup(); }
private void DrawInspector() { EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Interruptable")); SerializedProperty actionTemplate = serializedObject.FindProperty("actionTemplate"); EditorGUILayout.PropertyField(actionTemplate); EditorGUI.BeginDisabledGroup(EditorApplication.isPlaying || actionTemplate.objectReferenceValue != null); if (EditorTools.RightArrowButton(new GUIContent("Edit Behavior", "Trigger use behavior"), GUILayout.Height(20f))) { SerializedProperty actionList = serializedObject.FindProperty("actions"); ObjectWindow.ShowWindow("Edit Behavior", serializedObject, actionList); } EditorGUI.EndDisabledGroup(); }
private void DrawInspector() { EditorGUI.BeginDisabledGroup(EditorApplication.isPlaying); if (EditorTools.RightArrowButton(new GUIContent("Edit Behavior", "Trigger use behavior"), GUILayout.Height(20f))) { SerializedProperty actionList = serializedObject.FindProperty("actions"); for (int i = 0; i < actionList.arraySize; i++) { SerializedProperty element = actionList.GetArrayElementAtIndex(i); if (element.GetValue() == null) { serializedObject.Update(); element.managedReferenceValue = new MissingAction(); serializedObject.ApplyModifiedProperties(); } } ObjectWindow.ShowWindow("Edit Behavior", serializedObject, actionList); } EditorGUI.EndDisabledGroup(); }