Esempio n. 1
0
        public void Draw(MenuDesign menu, GUISkin skin)
        {
            if (buttonOut == null || menuOrigin == null || menuTarget == null)
            {
                NodeEditor.RemoveConnection(this);
                return;
            }
            Rect rectIn  = menuTarget.inPoint.rect;
            Rect rectOut = buttonOut.rect;

            DrawShadow(rectIn, rectOut);
            Handles.DrawBezier(
                rectIn.center,
                rectOut.center,
                rectIn.center + Vector2.left * 50f,
                rectOut.center - Vector2.left * 50f,
                NodeEditor.lineColor,
                null,
                NodeEditor.lineWidht
                );

            Vector3 btnPos  = (rectIn.center + rectOut.center) * 0.5f;
            float   btnSize = 24f;

            if (GUI.Button(new Rect(btnPos.x - (btnSize * 0.5f), btnPos.y - (btnSize * 0.5f), btnSize, btnSize), "╳", skin.button))
            {
                NodeEditor.RemoveConnection(this);
            }
        }
Esempio n. 2
0
        public void Draw(MenuDesign menu)
        {
            if (!(menu.nodes.Count > nodeIn) || !(menu.nodes.Count > nodeOut) || !(menu.nodes [nodeOut].outPoint.Count > buttonOut))
            {
                NodeEditor.RemoveConnection(this);
                return;
            }
            Rect rectIn  = menu.nodes [nodeIn].inPoint.rect;
            Rect rectOut = menu.nodes [nodeOut].outPoint [buttonOut].rect;

            DrawShadow(rectIn, rectOut);
            Handles.DrawBezier(
                rectIn.center,
                rectOut.center,
                rectIn.center + Vector2.left * 50f,
                rectOut.center - Vector2.left * 50f,
                NodeEditor.lineColor,
                null,
                NodeEditor.lineWidht
                );

            Vector3 btnPos  = (rectIn.center + rectOut.center) * 0.5f;
            float   btnSize = 24f;

            if (GUI.Button(new Rect(btnPos.x - (btnSize * 0.5f), btnPos.y - (btnSize * 0.5f), btnSize, btnSize), "╳", style))
            {
                NodeEditor.RemoveConnection(this);
            }
        }