public override void OnGUI(GUIContent label) { if (EditorTools.RightArrowButton(label, GUILayout.Height(20f))) { ObjectWindow.ShowWindow("Edit Actions", (IList)value, SetDirty); } }
public static void ShowWindow(string title, SerializedObject serializedObject, SerializedProperty serializedProperty) { ObjectWindow[] objArray = Resources.FindObjectsOfTypeAll <ObjectWindow>(); ObjectWindow window = (objArray.Length <= 0 ? ScriptableObject.CreateInstance <ObjectWindow>() : objArray[0]); window.hideFlags = HideFlags.HideAndDontSave; window.minSize = new Vector2(260f, 200f); window.titleContent = new GUIContent(title); window.Initialize(serializedObject, serializedProperty); window.ShowUtility(); }
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(); }
public static void ShowWindow(string title, IList list, System.Action onChange) { ObjectWindow[] objArray = Resources.FindObjectsOfTypeAll <ObjectWindow>(); ObjectWindow window = (objArray.Length <= 0 ? ScriptableObject.CreateInstance <ObjectWindow>() : objArray[0]); window.hideFlags = HideFlags.HideAndDontSave; window.minSize = new Vector2(260f, 200f); window.titleContent = new GUIContent(title); window.Initialize(list, onChange); window.ShowUtility(); }
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(); }