private void ShowEditingGUI() { EditorGUILayout.BeginVertical(CustomStyles.thinBox); showEditing = CustomGUILayout.ToggleHeader(showEditing, "ActionList editing settings"); if (showEditing) { displayActionsInInspector = CustomGUILayout.Toggle("List Actions in Inspector?", displayActionsInInspector, "AC.KickStarter.actionsManager.displayActionsInInspector", "If True, then Actions can be displayed in an ActionList's Inspector window"); displayActionsInEditor = (DisplayActionsInEditor)CustomGUILayout.EnumPopup("Actions in Editor are:", displayActionsInEditor, "AC.KickStarter.actionsManager.displayActionsInEditor", "How Actions are arranged in the ActionList Editor window"); actionListEditorScrollWheel = (ActionListEditorScrollWheel)CustomGUILayout.EnumPopup("Using scroll-wheel:", actionListEditorScrollWheel, "AC.KickStarter.actionsManager.actionListEditorScrollWheel", "The effect the mouse scrollwheel has inside the ActionList Editor window"); #if UNITY_EDITOR_OSX string altKey = "Option"; #else string altKey = "Alt"; #endif if (actionListEditorScrollWheel == ActionListEditorScrollWheel.ZoomsWindow) { EditorGUILayout.HelpBox("Panning is possible by holding down the middle-mouse button, or by scrolling with the " + altKey + " key pressed.", MessageType.Info); } else { EditorGUILayout.HelpBox("Zooming is possible by scrolling with the " + altKey + " key pressed.", MessageType.Info); } autoPanNearWindowEdge = CustomGUILayout.Toggle("Auto-panning in Editor?", autoPanNearWindowEdge, "AC.KickStarter.actionListManager.autoPanNearWindowEdge", "If True, the ActionList Editor will pan automatically when dragging the cursor near the window's edge"); panSpeed = CustomGUILayout.FloatField((actionListEditorScrollWheel == ActionListEditorScrollWheel.PansWindow) ? "Panning speed:" : "Zoom speed:", panSpeed, "AC.KickStarter.actionsManager.panSpeed", "The speed factor for panning/zooming"); invertPanning = CustomGUILayout.Toggle("Invert panning in Editor?", invertPanning, "AC.KickStarter.actionsManager.invertPanning", "If True, then panning is inverted in the ActionList Editor window (useful for Macbooks)"); allowMultipleActionListWindows = CustomGUILayout.Toggle("Allow multiple Editors?", allowMultipleActionListWindows, "AC.KickStarter.actionsManager.allowMultipleActionListWindows", "If True, then multiple ActionList Editor windows can be opened at once"); } EditorGUILayout.EndVertical(); }
public void ShowGUI() { EditorGUILayout.BeginVertical(CustomStyles.thinBox); showEditing = CustomGUILayout.ToggleHeader(showEditing, "ActionList editing settings"); if (showEditing) { displayActionsInInspector = CustomGUILayout.ToggleLeft("List Actions in Inspector window?", displayActionsInInspector, "AC.KickStarter.actionsManager.displayActionsInInspector"); displayActionsInEditor = (DisplayActionsInEditor)CustomGUILayout.EnumPopup("Actions in Editor are:", displayActionsInEditor, "AC.KickStarter.actionsManager.displayActionsInEditor"); actionListEditorScrollWheel = (ActionListEditorScrollWheel)CustomGUILayout.EnumPopup("Using scroll-wheel:", actionListEditorScrollWheel, "AC.KickStarter.actionsManager.actionListEditorScrollWheel"); if (actionListEditorScrollWheel == ActionListEditorScrollWheel.ZoomsWindow) { EditorGUILayout.HelpBox("Panning is possible by holding down the middle-mouse button.", MessageType.Info); } panSpeed = CustomGUILayout.FloatField((actionListEditorScrollWheel == ActionListEditorScrollWheel.PansWindow) ? "Panning speed:" : "Zoom speed:", panSpeed, "AC.KickStarter.actionsManager.panSpeed"); invertPanning = CustomGUILayout.ToggleLeft("Invert panning in ActionList Editor?", invertPanning, "AC.KickStarter.actionsManager.invertPanning"); allowMultipleActionListWindows = CustomGUILayout.ToggleLeft("Allow multiple ActionList Editor windows?", allowMultipleActionListWindows, "AC.KickStarter.actionsManager.allowMultipleActionListWindows"); } EditorGUILayout.EndVertical(); EditorGUILayout.Space(); EditorGUILayout.BeginVertical(CustomStyles.thinBox); showCustom = CustomGUILayout.ToggleHeader(showCustom, "Custom Action scripts"); if (showCustom) { GUILayout.BeginHorizontal(); GUILayout.Label("Folder to search:", GUILayout.Width(110f)); GUILayout.Label(customFolderPath, EditorStyles.textField); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Set directory", EditorStyles.miniButtonLeft)) { string path = EditorUtility.OpenFolderPanel("Set custom Actions directory", "Assets", ""); string dataPath = Application.dataPath; if (path.Contains(dataPath)) { if (path == dataPath) { customFolderPath = ""; } else { customFolderPath = path.Replace(dataPath + "/", ""); } } else { ACDebug.LogError("Cannot set new directory - be sure to select within the Assets directory."); } } if (GUILayout.Button("Clear", EditorStyles.miniButtonRight)) { customFolderPath = ""; } GUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); if (AllActions.Count > 0) { GUILayout.Space(10); Upgrade(); EditorGUILayout.BeginVertical(CustomStyles.thinBox); showCategories = CustomGUILayout.ToggleHeader(showCategories, "Action categories"); if (showCategories) { ActionCategory[] categories = (ActionCategory[])System.Enum.GetValues(typeof(ActionCategory)); for (int i = 0; i < categories.Length; i++) { toggles[i] = GUILayout.Toggle(toggles[i], categories[i].ToString(), "Button"); if (toggles[i]) { int j = -1; foreach (ActionType subclass in AllActions) { if (subclass.category == categories[i]) { j++; int enabledIndex = -1; if (EnabledActions.Contains(subclass)) { enabledIndex = EnabledActions.IndexOf(subclass); } if (selectedClass != null && subclass.category == selectedClass.category && subclass.title == selectedClass.title) { EditorGUILayout.BeginVertical("Button"); SpeechLine.ShowField("Name:", subclass.GetFullTitle(), false); SpeechLine.ShowField("Filename:", subclass.fileName + ".cs", false); SpeechLine.ShowField("Description:", subclass.description, true); subclass.isEnabled = true; EditorGUILayout.BeginHorizontal(); if (enabledIndex >= 0) { if (!string.IsNullOrEmpty(defaultClassName) && subclass.fileName == defaultClassName) { EditorGUILayout.LabelField("DEFAULT", CustomStyles.subHeader, GUILayout.Width(140f)); } else if (subclass.isEnabled) { if (GUILayout.Button("Make default?", GUILayout.Width(140f))) { if (EnabledActions.Contains(subclass)) { defaultClassName = subclass.fileName; } } } } subclass.color = EditorGUILayout.ColorField("Node colour:", subclass.color); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Search local instances")) { SearchForInstances(true, subclass); } if (GUILayout.Button("Search all instances")) { if (UnityVersionHandler.SaveSceneIfUserWants()) { SearchForInstances(false, subclass); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); } else { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(j.ToString() + ": " + subclass.GetFullTitle(), EditorStyles.label, GUILayout.Width(200f))) { selectedClass = subclass; } if (!string.IsNullOrEmpty(defaultClassName) && subclass.fileName == defaultClassName) { EditorGUILayout.LabelField("DEFAULT", CustomStyles.subHeader, GUILayout.Width(60f)); } EditorGUILayout.EndHorizontal(); GUILayout.Box("", GUILayout.ExpandWidth(true), GUILayout.Height(1)); } } } if (j < 0) { EditorGUILayout.HelpBox("There are no Actions of this category type present!", MessageType.Info); } } } } EditorGUILayout.EndVertical(); if (defaultClass > EnabledActions.Count - 1) { defaultClass = EnabledActions.Count - 1; } } else { EditorGUILayout.HelpBox("No Action subclass files found.", MessageType.Warning); } if (GUI.changed) { SetEnabled(); Upgrade(); EditorUtility.SetDirty(this); } }
public void ShowGUI() { EditorGUILayout.BeginVertical("Button"); GUILayout.Label("Actionlist editing settings", EditorStyles.boldLabel); displayActionsInInspector = EditorGUILayout.ToggleLeft("List Actions in Inspector window?", displayActionsInInspector); displayActionsInEditor = (DisplayActionsInEditor)EditorGUILayout.EnumPopup("Actions in Editor are:", displayActionsInEditor); actionListEditorScrollWheel = (ActionListEditorScrollWheel)EditorGUILayout.EnumPopup("Using scroll-wheel:", actionListEditorScrollWheel); invertPanning = EditorGUILayout.ToggleLeft("Invert panning in ActionList Editor?", invertPanning); allowMultipleActionListWindows = EditorGUILayout.ToggleLeft("Allow multiple ActionList Editor windows?", allowMultipleActionListWindows); EditorGUILayout.EndVertical(); EditorGUILayout.Space(); EditorGUILayout.BeginVertical("Button"); GUILayout.Label("Custom Action scripts", EditorStyles.boldLabel); GUILayout.BeginHorizontal(); GUILayout.Label("Folder to search:", GUILayout.Width(110f)); GUILayout.Label(customFolderPath, EditorStyles.textField); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Set directory")) { string path = EditorUtility.OpenFolderPanel("Set custom Actions directory", "Assets", ""); string dataPath = Application.dataPath; if (path.Contains(dataPath)) { if (path == dataPath) { customFolderPath = ""; } else { customFolderPath = path.Replace(dataPath + "/", ""); } } else { Debug.LogError("Cannot set new directory - be sure to select within the Assets directory."); } } GUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); if (AllActions.Count > 0) { GUILayout.Space(10); foreach (ActionType subclass in AllActions) { int enabledIndex = -1; if (EnabledActions.Contains(subclass)) { enabledIndex = EnabledActions.IndexOf(subclass); } if (selectedClass != null && subclass.category == selectedClass.category && subclass.title == selectedClass.title) { EditorGUILayout.BeginVertical("Button"); SpeechLine.ShowField("Name:", subclass.GetFullTitle(), false); SpeechLine.ShowField("Filename:", subclass.fileName, false); SpeechLine.ShowField("Description:", subclass.description, true); subclass.isEnabled = true; // This is being set OnEnable anyway, because Action Types are now refreshed/generated automatically, so can't disable //subclass.isEnabled = EditorGUILayout.Toggle ("Is enabled?", subclass.isEnabled); EditorGUILayout.BeginHorizontal(); if (enabledIndex >= 0) { if (enabledIndex == defaultClass) { EditorGUILayout.LabelField("DEFAULT", EditorStyles.boldLabel, GUILayout.Width(70f)); } else if (subclass.isEnabled) { if (GUILayout.Button("Make default?")) { if (EnabledActions.Contains(subclass)) { defaultClass = EnabledActions.IndexOf(subclass); } } } } if (GUILayout.Button("Search local instances")) { SearchForInstances(true, subclass); } if (GUILayout.Button("Search all instances")) { SearchForInstances(false, subclass); } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); } else { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(subclass.GetFullTitle(), EditorStyles.label, GUILayout.Width(200f))) { selectedClass = subclass; } if (enabledIndex >= 0 && enabledIndex == defaultClass) { EditorGUILayout.LabelField("DEFAULT", EditorStyles.boldLabel, GUILayout.Width(60f)); } EditorGUILayout.EndHorizontal(); GUILayout.Box("", GUILayout.ExpandWidth(true), GUILayout.Height(1)); } } if (defaultClass > EnabledActions.Count - 1) { defaultClass = EnabledActions.Count - 1; } } else { EditorGUILayout.HelpBox("No Action subclass files found.", MessageType.Warning); } if (GUI.changed) { SetEnabled(); EditorUtility.SetDirty(this); } }
private void ArrangeFromIndex(List<Action> actionList, int i, int depth, float minValue, DisplayActionsInEditor _display) { while (i > -1 && actionList.Count > i) { Action _action = actionList[i]; if (i > 0 && _action.isMarked) { if (_display == DisplayActionsInEditor.ArrangedVertically) { _action.nodeRect.x = 14 + (350 * depth); // Find top-most Y position float yPos = minValue; bool doAgain = true; while (doAgain) { int numChanged = 0; foreach (Action otherAction in actionList) { if (otherAction != _action && otherAction.nodeRect.x == _action.nodeRect.x && otherAction.nodeRect.y >= yPos) { yPos = otherAction.nodeRect.y + otherAction.nodeRect.height + 30f; numChanged ++; } } if (numChanged == 0) { doAgain = false; } } _action.nodeRect.y = yPos; } else { _action.nodeRect.y = 14 + (260 * depth); // Find left-most X position float xPos = minValue + 350; bool doAgain = true; while (doAgain) { int numChanged = 0; foreach (Action otherAction in actionList) { if (otherAction != _action && otherAction.nodeRect.x == xPos && otherAction.nodeRect.y == _action.nodeRect.y) { xPos += 350; numChanged ++; } } if (numChanged == 0) { doAgain = false; } } _action.nodeRect.x = xPos; } } if (_action.isMarked == false) { return; } _action.isMarked = false; float newMinValue = 0f; if (_display == DisplayActionsInEditor.ArrangedVertically) { newMinValue = _action.nodeRect.y + _action.nodeRect.height + 30f; } else { newMinValue = _action.nodeRect.x; } if (_action is ActionCheckMultiple) { ActionCheckMultiple _actionCheckMultiple = (ActionCheckMultiple) _action; for (int j=_actionCheckMultiple.endings.Count-1; j>=0; j--) { ActionEnd ending = _actionCheckMultiple.endings [j]; if (j >= 0) { if (ending.resultAction == ResultAction.Skip) { int newDepth = depth; for (int k = 0; k<j; k++) { ActionEnd prevEnding = _actionCheckMultiple.endings [k]; if (prevEnding.resultAction == ResultAction.Continue || (prevEnding.resultAction == ResultAction.Skip && prevEnding.skipAction != i)) { newDepth ++; } } ArrangeFromIndex (actionList, actionList.IndexOf (ending.skipActionActual), newDepth, newMinValue, _display); } else if (ending.resultAction == ResultAction.Continue) { ArrangeFromIndex (actionList, i+1, depth+j, newMinValue, _display); } } } } if (_action is ActionParallel) { ActionParallel _ActionParallel = (ActionParallel) _action; for (int j=_ActionParallel.endings.Count-1; j>=0; j--) { ActionEnd ending = _ActionParallel.endings [j]; if (j >= 0) // Want this to run for all, now { if (ending.resultAction == ResultAction.Skip) { ArrangeFromIndex (actionList, actionList.IndexOf (ending.skipActionActual), depth+j, newMinValue, _display); } else if (ending.resultAction == ResultAction.Continue) { ArrangeFromIndex (actionList, i+1, depth+j, newMinValue, _display); } } else { if (ending.resultAction == ResultAction.Skip) { i = actionList.IndexOf (ending.skipActionActual); } else if (ending.resultAction == ResultAction.Continue) { i++; } else { i = -1; } } } } else if (_action is ActionCheck) { ActionCheck _actionCheck = (ActionCheck) _action; if (_actionCheck.resultActionFail == ResultAction.Stop || _actionCheck.resultActionFail == ResultAction.RunCutscene) { if (_actionCheck.resultActionTrue == ResultAction.Skip) { i = actionList.IndexOf (_actionCheck.skipActionTrueActual); } else if (_actionCheck.resultActionTrue == ResultAction.Continue) { i++; } else { i = -1; } } else { if (_actionCheck.resultActionTrue == ResultAction.Skip) { ArrangeFromIndex (actionList, actionList.IndexOf (_actionCheck.skipActionTrueActual), depth+1, newMinValue, _display); } else if (_actionCheck.resultActionTrue == ResultAction.Continue) { ArrangeFromIndex (actionList, i+1, depth+1, newMinValue, _display); } if (_actionCheck.resultActionFail == ResultAction.Skip) { i = actionList.IndexOf (_actionCheck.skipActionFailActual); } else if (_actionCheck.resultActionFail == ResultAction.Continue) { i++; } else { i = -1; } } } else { if (_action.endAction == ResultAction.Skip) { i = actionList.IndexOf (_action.skipActionActual); } else if (_action.endAction == ResultAction.Continue) { i++; } else { i = -1; } } } }
public void ShowGUI() { EditorGUILayout.BeginVertical ("Button"); GUILayout.Label ("Actionlist editing settings", EditorStyles.boldLabel); displayActionsInInspector = EditorGUILayout.ToggleLeft ("List Actions in Inspector window?", displayActionsInInspector); displayActionsInEditor = (DisplayActionsInEditor) EditorGUILayout.EnumPopup ("Actions in Editor are:", displayActionsInEditor); actionListEditorScrollWheel = (ActionListEditorScrollWheel) EditorGUILayout.EnumPopup ("Using scroll-wheel:", actionListEditorScrollWheel); invertPanning = EditorGUILayout.ToggleLeft ("Invert panning in ActionList Editor?", invertPanning); allowMultipleActionListWindows = EditorGUILayout.ToggleLeft ("Allow multiple ActionList Editor windows?", allowMultipleActionListWindows); EditorGUILayout.EndVertical (); EditorGUILayout.Space (); EditorGUILayout.BeginVertical ("Button"); GUILayout.Label ("Custom Action scripts", EditorStyles.boldLabel); GUILayout.BeginHorizontal (); GUILayout.Label ("Folder to search:", GUILayout.Width (110f)); GUILayout.Label (customFolderPath, EditorStyles.textField); GUILayout.EndHorizontal (); GUILayout.BeginHorizontal (); if (GUILayout.Button ("Set directory")) { string path = EditorUtility.OpenFolderPanel("Set custom Actions directory", "Assets", ""); string dataPath = Application.dataPath; if (path.Contains (dataPath)) { if (path == dataPath) { customFolderPath = ""; } else { customFolderPath = path.Replace (dataPath + "/", ""); } } else { ACDebug.LogError ("Cannot set new directory - be sure to select within the Assets directory."); } } GUILayout.EndHorizontal (); EditorGUILayout.EndVertical (); if (AllActions.Count > 0) { GUILayout.Space (10); foreach (ActionType subclass in AllActions) { int enabledIndex = -1; if (EnabledActions.Contains (subclass)) { enabledIndex = EnabledActions.IndexOf (subclass); } if (selectedClass != null && subclass.category == selectedClass.category && subclass.title == selectedClass.title) { EditorGUILayout.BeginVertical ("Button"); SpeechLine.ShowField ("Name:", subclass.GetFullTitle (), false); SpeechLine.ShowField ("Filename:", subclass.fileName, false); SpeechLine.ShowField ("Description:", subclass.description, true); subclass.isEnabled = true; // This is being set OnEnable anyway, because Action Types are now refreshed/generated automatically, so can't disable //subclass.isEnabled = EditorGUILayout.Toggle ("Is enabled?", subclass.isEnabled); EditorGUILayout.BeginHorizontal (); if (enabledIndex >= 0) { if (enabledIndex == defaultClass) { EditorGUILayout.LabelField ("DEFAULT", EditorStyles.boldLabel, GUILayout.Width (140f)); } else if (subclass.isEnabled) { if (GUILayout.Button ("Make default?", GUILayout.Width (140f))) { if (EnabledActions.Contains (subclass)) { defaultClass = EnabledActions.IndexOf (subclass); } } } } subclass.color = EditorGUILayout.ColorField ("Node colour:", subclass.color); EditorGUILayout.EndHorizontal (); EditorGUILayout.BeginHorizontal (); if (GUILayout.Button ("Search local instances")) { SearchForInstances (true, subclass); } if (GUILayout.Button ("Search all instances")) { SearchForInstances (false, subclass); } EditorGUILayout.EndHorizontal (); EditorGUILayout.EndVertical (); } else { EditorGUILayout.BeginHorizontal (); if (GUILayout.Button (subclass.GetFullTitle (), EditorStyles.label, GUILayout.Width (200f))) { selectedClass = subclass; } if (enabledIndex >= 0 && enabledIndex == defaultClass) { EditorGUILayout.LabelField ("DEFAULT", EditorStyles.boldLabel, GUILayout.Width (60f)); } EditorGUILayout.EndHorizontal (); GUILayout.Box ("", GUILayout.ExpandWidth (true), GUILayout.Height(1)); } } if (defaultClass > EnabledActions.Count - 1) { defaultClass = EnabledActions.Count - 1; } } else { EditorGUILayout.HelpBox ("No Action subclass files found.", MessageType.Warning); } if (GUI.changed) { SetEnabled (); EditorUtility.SetDirty (this); } }
public void ShowGUI() { EditorGUILayout.BeginVertical ("Button"); GUILayout.Label ("Actionlist editing settings", EditorStyles.boldLabel); displayActionsInInspector = EditorGUILayout.ToggleLeft ("List Actions in Inspector window?", displayActionsInInspector); displayActionsInEditor = (DisplayActionsInEditor) EditorGUILayout.EnumPopup ("Actions in Editor are:", displayActionsInEditor); actionListEditorScrollWheel = (ActionListEditorScrollWheel) EditorGUILayout.EnumPopup ("Using scroll-wheel:", actionListEditorScrollWheel); panSpeed = EditorGUILayout.FloatField ((actionListEditorScrollWheel == ActionListEditorScrollWheel.PansWindow) ? "Panning speed:" : "Zoom speed:", panSpeed); invertPanning = EditorGUILayout.ToggleLeft ("Invert panning in ActionList Editor?", invertPanning); allowMultipleActionListWindows = EditorGUILayout.ToggleLeft ("Allow multiple ActionList Editor windows?", allowMultipleActionListWindows); EditorGUILayout.EndVertical (); EditorGUILayout.Space (); EditorGUILayout.BeginVertical ("Button"); GUILayout.Label ("Custom Action scripts", EditorStyles.boldLabel); GUILayout.BeginHorizontal (); GUILayout.Label ("Folder to search:", GUILayout.Width (110f)); GUILayout.Label (customFolderPath, EditorStyles.textField); GUILayout.EndHorizontal (); GUILayout.BeginHorizontal (); if (GUILayout.Button ("Set directory")) { string path = EditorUtility.OpenFolderPanel("Set custom Actions directory", "Assets", ""); string dataPath = Application.dataPath; if (path.Contains (dataPath)) { if (path == dataPath) { customFolderPath = ""; } else { customFolderPath = path.Replace (dataPath + "/", ""); } } else { ACDebug.LogError ("Cannot set new directory - be sure to select within the Assets directory."); } } GUILayout.EndHorizontal (); EditorGUILayout.EndVertical (); if (AllActions.Count > 0) { GUILayout.Space (10); EditorGUILayout.BeginVertical ("Button"); EditorGUILayout.LabelField ("Action categories", EditorStyles.boldLabel); ActionCategory[] categories = (ActionCategory[]) System.Enum.GetValues (typeof(ActionCategory)); for (int i=0; i<categories.Length; i++) { toggles[i] = GUILayout.Toggle (toggles[i], categories[i].ToString (), "Button"); if (toggles[i]) { int j=-1; foreach (ActionType subclass in AllActions) { if (subclass.category == categories[i]) { j++; int enabledIndex = -1; if (EnabledActions.Contains (subclass)) { enabledIndex = EnabledActions.IndexOf (subclass); } if (selectedClass != null && subclass.category == selectedClass.category && subclass.title == selectedClass.title) { EditorGUILayout.BeginVertical ("Button"); SpeechLine.ShowField ("Name:", subclass.GetFullTitle (), false); SpeechLine.ShowField ("Filename:", subclass.fileName, false); SpeechLine.ShowField ("Description:", subclass.description, true); subclass.isEnabled = true; EditorGUILayout.BeginHorizontal (); if (enabledIndex >= 0) { if (enabledIndex == defaultClass) { EditorGUILayout.LabelField ("DEFAULT", EditorStyles.boldLabel, GUILayout.Width (140f)); } else if (subclass.isEnabled) { if (GUILayout.Button ("Make default?", GUILayout.Width (140f))) { if (EnabledActions.Contains (subclass)) { defaultClass = EnabledActions.IndexOf (subclass); } } } } subclass.color = EditorGUILayout.ColorField ("Node colour:", subclass.color); EditorGUILayout.EndHorizontal (); EditorGUILayout.BeginHorizontal (); if (GUILayout.Button ("Search local instances")) { SearchForInstances (true, subclass); } if (GUILayout.Button ("Search all instances")) { if (UnityVersionHandler.SaveSceneIfUserWants ()) { SearchForInstances (false, subclass); } } EditorGUILayout.EndHorizontal (); EditorGUILayout.EndVertical (); } else { EditorGUILayout.BeginHorizontal (); if (GUILayout.Button (j.ToString () + ": " + subclass.GetFullTitle (), EditorStyles.label, GUILayout.Width (200f))) { selectedClass = subclass; } if (enabledIndex >= 0 && enabledIndex == defaultClass) { EditorGUILayout.LabelField ("DEFAULT", EditorStyles.boldLabel, GUILayout.Width (60f)); } EditorGUILayout.EndHorizontal (); GUILayout.Box ("", GUILayout.ExpandWidth (true), GUILayout.Height(1)); } } } if (j < 0) { EditorGUILayout.HelpBox ("There are no Actions of this category type present!", MessageType.Info); } } } EditorGUILayout.EndVertical (); if (defaultClass > EnabledActions.Count - 1) { defaultClass = EnabledActions.Count - 1; } } else { EditorGUILayout.HelpBox ("No Action subclass files found.", MessageType.Warning); } if (GUI.changed) { SetEnabled (); EditorUtility.SetDirty (this); } }