Example #1
0
        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();
        }
Example #2
0
 public void OnUpdate(GAEditor editor)
 {
     if (Input.GetMouseButtonUp(0))
     {
         editor.ChangeStateTo(State.Idle);
     }
 }
Example #3
0
        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);
            }
        }
Example #4
0
        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;
        }
Example #5
0
        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);
            }
        }
Example #6
0
        public void OnExit(GAEditor editor)
        {
            Vector3 endPosition = Input.mousePosition;

            editor.AddToHistory(new DragCommand(startPosition, endPosition, dragedItem));
        }
Example #7
0
 public void OnEnter(GAEditor editor)
 {
     startPosition = Input.mousePosition;
     dragedItem    = editor.ActiveItem as IDragable;
 }
Example #8
0
 public void OnExit(GAEditor editor)
 {
 }
Example #9
0
 public void OnUpdate(GAEditor editor)
 {
 }
Example #10
0
 public void OnEnter(GAEditor editor)
 {
 }