public void Draw(EditorWindow main, GAEditor editor) { Handles.BeginGUI(); if (destination == null) { Rect r1 = source.Rectangle; Vector3 p1 = r1.center; Vector3 p2 = Input.mousePosition; Vector3 p3 = p1 + source.Direction * 20; Vector3 p4 = p2; Handles.DrawBezier(p1, p2, p3, p4, Color.red, null, 5f); } else { Rect r1 = source.Rectangle; Rect r2 = destination.Rectangle; Vector3 p1 = r1.center; Vector3 p2 = r2.center; Vector3 p3 = p1 + source.Direction * 20; Vector3 p4 = p2 + destination.Direction * 20; Handles.DrawBezier(p1, p2, p3, p4, Color.red, null, 5f); } Handles.EndGUI(); }
public void OnUpdate(GAEditor editor) { if (Input.GetMouseButtonUp(0)) { editor.ChangeStateTo(State.Idle); } }
public void Draw(EditorWindow main, GAEditor editor) { foreach (Node n in nodes) { n.Draw(main, editor); } foreach (Edge e in edges) { e.Draw(main, editor); } }
public void Draw(EditorWindow main, GAEditor editor) { main.BeginWindows(); rect = GUI.Window(0, rect, DrawWindow, "Box1"); main.EndWindows(); int size = GUI.skin.button.fontSize; GUI.skin.button.fontSize = 10; for (int i = 0; i < nodecs.Length; i++) { nodecs[i].Draw(main, editor); } GUI.skin.button.fontSize = size; }
public void Draw(EditorWindow main, GAEditor editor) { Rect parentRect = parent.Rectangle; rect.center = parentRect.center + offset; if (GUI.Button(rect, "Mate")) { edge = new Edge(this); } if (edge != null) { edge.Draw(main, editor); } }
public void OnExit(GAEditor editor) { Vector3 endPosition = Input.mousePosition; editor.AddToHistory(new DragCommand(startPosition, endPosition, dragedItem)); }
public void OnEnter(GAEditor editor) { startPosition = Input.mousePosition; dragedItem = editor.ActiveItem as IDragable; }
public void OnExit(GAEditor editor) { }
public void OnUpdate(GAEditor editor) { }
public void OnEnter(GAEditor editor) { }