private static void OpenWindow() { NodeBasedEditor window = GetWindow <NodeBasedEditor>(); window.titleContent = new GUIContent("Node Editor"); window.autoRepaintOnSceneChange = true; }
public Node( Vector2 position, Action <ConnectionPoint> OnClickInPoint, Action <ConnectionPoint> OnClickOutPoint, Action <Node> OnClickRemoveNode, DataGraphNode newDataNode, NodeBasedEditor editor ) { dataNode = newDataNode; currentEditor = editor; SetStyles(); UpdateSize(); rect = new Rect(position.x, position.y, width, height); inPoint = new ConnectionPoint(this, ConnectionPointType.In, OnClickInPoint); outPoint = new ConnectionPoint(this, ConnectionPointType.Out, OnClickOutPoint); OnRemoveNode = OnClickRemoveNode; if (dataNode.uiSettings != null) { rect = dataNode.uiSettings.rect; } else { dataNode.SetUIRect(rect); } inspector = Editor.CreateEditor(dataNode); }
private static void OpenWindow() { // Create editor window and set title NodeBasedEditor window = GetWindow <NodeBasedEditor>(); window.titleContent = new GUIContent("Dialogue Editor"); }
public NodeEditorDeserializer(SerializedNodeEditor data, NodeBasedEditor editor) { scriptedNodes = new Queue <SerializedScriptedNode>(data.scriptedNodes); typedNodes = new Queue <SerializedTypedNode>(data.typedNodes); optionNodes = new Queue <SerializedOptionsNode>(data.optionNodes); this.editor = editor; count = data.count; }
static NodeBasedEditor OpenWindow() { NodeBasedEditor window = GetWindow <NodeBasedEditor>(); window.titleContent = new GUIContent("Node Based Editor"); window.MySkillTree = ScriptableObject.CreateInstance <SkillTreeData>(); return(window); }
public EditorNode(NodeBasedEditor editor, BaseCutsceneNode actualNode, Vector2 position, GUIStyle headerStyle, GUIStyle boxStyle) { rect = new Rect(position.x, position.y, 140, 20); this.editor = editor; this.actualNode = actualNode; this.headerStyle = headerStyle; this.boxStyle = boxStyle; previousActualNodePosition = actualNode.transform.position; }
private static void OpenWindow() { NodeBasedEditor window = GetWindow <NodeBasedEditor>(); window.titleContent = new GUIContent("Node Based Editor"); window.minSize = new Vector2(800f, 600f); window.wantsMouseMove = true; window.Show(); }
public void OpenWindow(CutsceneManager manager) { this.cutsceneManager = manager; NodeBasedEditor window = GetWindow <NodeBasedEditor>(); window.titleContent = new GUIContent("Cutscene Sequence Editor"); nodes = new Dictionary <BaseCutsceneNode, EditorNode>(); AddNodesFromCutscene(); }
public void Draw(NodeBasedEditor window) { inPoint.Draw(window); outPoint.Draw(window); Rect zoomRect = new Rect(rect); zoomRect.center = window._zoomCoordsOrigin + rect.center; GUI.Box(zoomRect, title, style); }
public Node(Rect _rect, GUIStyle nodeStyle, GUIStyle selectedStyle, GUIStyle inPointStyle, GUIStyle outPointStyle, GUIStyle _titleStyle, Action <Node> OnClickRemoveNode, NodeBasedEditor editor, int nodeID) { privRect = _rect; style = nodeStyle; ID = nodeID; defaultNodeStyle = nodeStyle; selectedNodeStyle = selectedStyle; titleStyle = _titleStyle; OnRemoveNode = OnClickRemoveNode; editorInstance = editor; playedAudioClips.Add(null); delays.Add(0); showAudio.Add(true); }
public override void OnInspectorGUI() { GUI.enabled = false; EditorGUILayout.ObjectField("Script:", MonoScript.FromScriptableObject((BossBehaviour)target), typeof(BossBehaviour), false); GUI.enabled = true; var bossBehaviour = (BossBehaviour)target; GUILayout.Label(string.Format("{0} node(s)", bossBehaviour.TotalNodeCount)); if (GUILayout.Button("View in Editor")) { NodeBasedEditor.EditBossBehaviour(bossBehaviour); } }
private static void OpenWindow() { if (EditorApplication.isPlaying) { //NodeBasedEditor window = GetWindow<NodeBasedEditor>(); NodeBasedEditor window = new NodeBasedEditor(GameObject.FindObjectOfType <MMIAvatar>()); window.Show(); window.titleContent = new GUIContent("CoSimulation Hierachy Editor"); } else { EditorUtility.DisplayDialog("Cannot open window", "Please enter play mode to open the window", "OK"); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); GUILayout.BeginHorizontal(); GUILayout.Label("Nodes in this cutscene: " + cutsceneManager.nodes.Count); GUILayout.EndHorizontal(); EditorGUILayout.Separator(); if (nodeTypes == null) { RefreshNodeTypes(); } if (GUILayout.Button("Open in Sequence Editor", GUILayout.Width(255))) { NodeBasedEditor window = (NodeBasedEditor)EditorWindow.GetWindow(typeof(NodeBasedEditor)); window.OpenWindow(cutsceneManager); } EditorGUILayout.BeginHorizontal(); showNodeTypes = EditorGUILayout.Foldout(showNodeTypes, "Create nodes"); if (GUILayout.Button("Refesh node types")) { RefreshNodeTypes(); } EditorGUILayout.EndHorizontal(); if (showNodeTypes) { foreach (Type type in nodeTypes) { if (GUILayout.Button("Create new " + type.Name)) { BaseCutsceneNode node = new GameObject().AddComponent(type).GetComponent <BaseCutsceneNode>(); node.cutsceneManager = cutsceneManager; node.transform.SetParent(cutsceneManager.transform); node.transform.position = cutsceneManager.transform.position; node.name = "New " + type.Name; } } } }
public override void OnInspectorGUI() { EditorGUILayout.LabelField("Size", dataGraph.Size.ToString()); if (GUILayout.Button(openNodeEditorText)) { if (nodeBasedEditor == null) { nodeBasedEditor = BindNodeEditorWindow(); nodeBasedEditor.onDataChange -= OnNodeEditorDataChange; nodeBasedEditor.onDataChange += OnNodeEditorDataChange; } nodeBasedEditor.Show(); nodeBasedEditor.ClearData(); nodeBasedEditor.SetData(ref dataGraph, OnCreateDataNode, OnRemoveDataNode, OnCreateDataEdge, OnRemoveDataEdge); nodeBasedEditor.Repaint(); } if (GUILayout.Button(closeNodeEditorText)) { if (nodeBasedEditor == null) { nodeBasedEditor = BindNodeEditorWindow(); nodeBasedEditor.onDataChange -= OnNodeEditorDataChange; nodeBasedEditor.onDataChange += OnNodeEditorDataChange; } nodeBasedEditor.ClearData(); nodeBasedEditor.Repaint(); nodeBasedEditor = null; } OnNodeEditorDataChange(); }
private static void OpenWindow() { NodeBasedEditor window = GetWindow <NodeBasedEditor>(); window.titleContent = new GUIContent("Node Based Editor"); }
public static void OpenWindow() { NodeBasedEditor _window = GetWindow <NodeBasedEditor>(); _window.titleContent = new GUIContent("Node Based Editor"); }