public static void InitEditorWindow() { currentWindow = EditorWindow.GetWindow <AG_GameFlowMainWindow>(); currentWindow.titleContent = new GUIContent("Game Flow"); }
private void OnGUI() { if (currentWindow == null) { currentWindow = EditorWindow.GetWindow <AG_GameFlowMainWindow>(); } //GUIUtility.ScaleAroundPivot(scale, pivotPoint); // Skin loading //if (viewSkin == null) // viewSkin = Resources.Load<GUISkin>("GUI Skins/Editor Skins/Node Editor Skin"); windowRect = new Rect(0, 0, position.width, position.height); // Title string graphTitle = ""; if (currentGraph == null) { graphTitle = "No Chapter loaded"; } else { graphTitle = currentGraph.graphName; } GUI.Box(new Rect(0, 0, position.width, position.height), graphTitle); NodesGUI(); LinksGUI(); //Bottom Area (Chapter choose) //Rect bottomRect = new Rect(10, position.height - 30.0f, 200, 30.0f); //GUILayout.BeginArea(bottomRect); //if (GUILayout.Button("Press me")) // Debug.Log("Button pressed"); //GUILayout.EndArea(); // Get and process the current event Event e = Event.current; ProcessEvents(e); if (draggingLinkNode) { if (clickedOutputPoint != null) { subjectnerd.GLDraw.DrawConnectingCurve(clickedOutputPoint.imageRect.center, e.mousePosition, Color.red, 1.2f); } } UpdateLinks(); //if (e.type == EventType.ScrollWheel) //{ // var zoomDelta = 0.1f; // zoomDelta = e.delta.y < 0 ? zoomDelta : -zoomDelta; // zoomScale += zoomDelta; // zoomScale = Mathf.Clamp(zoomScale, 0.25f, 1.25f); // scale = new Vector2 (zoomScale, zoomScale); // pivotPoint = e.mousePosition; // e.Use(); //} //Scale // pivotPoint = e.mousePosition; Repaint(); }
public static void OpenGameFlowWindow() { AG_GameFlowMainWindow.InitEditorWindow(); }