/// <summary> /// Open the specified FSM in the Playmaker Editor /// </summary> public static void OpenInEditor(PlayMakerFSM fsmComponent) { if (FsmEditor.Instance == null) { FsmEditorWindow.OpenWindow(fsmComponent); } else { FsmEditor.SelectFsm(fsmComponent.FsmTemplate == null ? fsmComponent.Fsm : fsmComponent.FsmTemplate.fsm); } }
public override IEnumerator CaptureDocScreenshots() { position = new Rect(100, 100, 695, 305); FsmEditorSettings.GraphViewShowMinimap = false; FsmEditorSettings.ShowScrollBars = false; FsmEditorSettings.ShowFsmDescriptionInGraphView = false; EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo(); EditorSceneManager.OpenScene("assets/docs/fake-scene.unity"); Selection.activeGameObject = GameObject.FindWithTag("MainCamera"); FsmEditor.SelectFsm(Selection.activeGameObject.GetComponent <PlayMakerFSM>()); FsmEditor.Inspector.SetMode(InspectorMode.StateInspector); FsmEditor.InspectorPanelWidth = 350; FsmEditor.GraphView.SetScrollPosition(new Vector2(0, -30)); FsmEditor.Selection.ActiveTransition = null; Repaint(); yield return(this.StartCoroutine(Capture("main-editor"))); //FsmEditor.Inspector.SetMode(InspectorMode.FsmInspector); var captureWidth = position.width; var inspectorModeArea = new Rect(position.xMax - captureWidth, position.y, captureWidth, 87); yield return(this.StartCoroutine(Capture("inspector-modes", inspectorModeArea))); var selectionToolbarArea = new Rect(position.x, position.y, position.width - 345, 100); yield return(this.StartCoroutine(Capture("selection-toolbar", selectionToolbarArea))); Selection.activeGameObject = GameObject.Find("Camera"); FsmEditor.SelectFsm(Selection.activeGameObject.GetComponent <PlayMakerFSM>()); FsmEditor.Inspector.SetMode(InspectorMode.Watermarks); yield return(this.StartCoroutine(Capture("inspector-watermarks"))); var inspectorArea = new Rect(position.xMax - 350, position.y, 350, position.height); FsmEditor.Inspector.SetMode(InspectorMode.StateInspector); yield return(this.StartCoroutine(Capture("state-inspector", inspectorArea))); FsmEditor.Inspector.SetMode(InspectorMode.EventManager); yield return(this.StartCoroutine(Capture("event-manager", inspectorArea))); FsmEditor.Inspector.SetMode(InspectorMode.VariableManager); yield return(this.StartCoroutine(Capture("variable-manager", inspectorArea))); /* Doesn't work. Dropdown is modal? * MainToolbar.ScreenshotMessageId = 2; Repaint(); * yield return this.StartCoroutine(Capture("fsm-selection-dropdown", selectionToolbarArea)); * MainToolbar.ScreenshotMessageId = 0;*/ }
/// <summary> /// Open a PlayMakerFSM component in the main FSM Editor. /// If the component uses a template we select it to edit. /// </summary> public static void OpenInEditor(PlayMakerFSM fsmComponent) { if (!IsOpen()) { OpenWindow(fsmComponent); } else { FocusWindowIfItsOpen <FsmEditorWindow>(); FsmEditor.SelectFsm(fsmComponent.FsmTemplate == null ? fsmComponent.Fsm : fsmComponent.FsmTemplate.fsm); } }
void ClearTemplate() { fsmComponent.Reset(); fsmTemplate = null; BuildFsmVariableList(); if (FsmEditor.SelectedFsmComponent == fsmComponent) { FsmEditor.SelectFsm(fsmComponent.Fsm); } }
void ClearTemplate() { fsmComponent.Reset(); fsmTemplate = null; BuildFsmVariableList(); // If we were editing the template in the Playmaker editor // handle this gracefully by reselecting the base FSM if (FsmEditor.SelectedFsmComponent == fsmComponent) { FsmEditor.SelectFsm(fsmComponent.Fsm); } }
/// <summary> /// Open the Fsm Editor and select an Fsm Component /// </summary> public static void OpenWindow(FsmTemplate fsmTemplate) { OpenWindow(); FsmEditor.SelectFsm(fsmTemplate.fsm); }
/// <summary> /// Open the Fsm Editor and select an Fsm Component /// </summary> public static void OpenWindow(PlayMakerFSM fsmComponent) { OpenWindow(); FsmEditor.SelectFsm(fsmComponent.Fsm); }