Пример #1
0
 private void DrawInPoint(Node node, GUISkin skin, ref Rect rect, Rect label)
 {
     if (node.outPoint.Count > 1)
     {
         rect.y = node.rect.y + (node.rect.height * 0.5f) - rect.height * 0.5f;
     }
     else
     {
         rect.y = node.rect.y + 25;
     }
     rect.x   = node.rect.x - rect.width + 8f;
     label.x  = rect.x;
     label.y  = rect.y;
     label.x += 20;
     skin.label.alignment = TextAnchor.MiddleLeft;
     GUI.Label(label, "Open", skin.label);
     if (GUI.Button(rect, "", skin.button))
     {
         NodeEditor.ClickInPoint(this);
     }
 }
Пример #2
0
        public void Draw(Node node, int i)
        {
            id = i;
            Rect label = labelRect;

            switch (type)
            {
            case ConnectionPointType.In:
                rect.y   = node.rect.y + (node.rect.height * 0.5f) - rect.height * 0.5f;
                rect.x   = node.rect.x - rect.width + 8f;
                label.x  = rect.x;
                label.y  = rect.y;
                label.x += 20;
                labelStyle.alignment = TextAnchor.MiddleLeft;
                GUI.Label(label, "Enable", labelStyle);
                if (GUI.Button(rect, "", style))
                {
                    NodeEditor.ClickInPoint(this);
                }
                break;

            case ConnectionPointType.Out:
                if (id >= node.menu.transitionButtons.Length)
                {
                    return;
                }
                rect.y   = node.rect.y + 25 * (id + 1);
                rect.x   = node.rect.x + node.rect.width - 8f;
                label.x  = rect.x;
                label.y  = rect.y;
                label.x -= label.width;
                labelStyle.alignment = TextAnchor.MiddleRight;
                GUI.Label(label, node.menu.transitionButtons[id].name, labelStyle);
                if (GUI.Button(rect, "", style))
                {
                    NodeEditor.ClickOutPoint(this);
                }
                break;
            }
        }
Пример #3
0
 private void OnClickRemoveNode()
 {
     NodeEditor.RemoveNode(this);
 }
Пример #4
0
 private void OnEnable()
 {
     singleton = this;
     SetList();
 }