public void DeleteTransition(object obj)
        {
            JunctionPosition position = obj as JunctionPosition;

            if (ConnectorManager.IsConnected(this, (JunctionPosition)position))
            {
                ConnectorManager.Disconnect(this, position);
            }
        }
Beispiel #2
0
 void minusClick()
 {
     clickCount--;
     hgt       = 80 + 25 * (clickCount - 1);
     this.rect = new Rect(this.rect.x, this.rect.y, width, hgt);
     conditions.RemoveAt(clickCount - 1);
     if (ConnectorManager.IsConnected(this, clickCount))
     {
         ConnectorManager.Disconnect(this, clickCount);
     }
 }
Beispiel #3
0
    public void Update()
    {
        position_x = (int)(rect.x);
        position_y = (int)(rect.y);

        rect = GUI.Window(id, rect, WindowCallback, String.Empty);
        Vector2 btnRect = new Vector2(25, 20);

        if (GUI.Button(new Rect(rect.x + rect.width - btnRect.x - 3, rect.y - btnRect.y, btnRect.x, btnRect.y), "×"))
        {
            NodeArrow.cs.SlideOut();
            NodeArrow.ps.SlideOut();

            // 曲線削除
            for (int i = 0; i < clickCount; i++)
            {
                if (ConnectorManager.IsConnected(this, i))
                {
                    ConnectorManager.Disconnect(this, i);
                }
            }

            // Node削除
            GameObject.Find("Node").GetComponent <NodeArrow>().Delete(this.id);
        }


        for (int element = 0; element < clickCount; element++)
        {
            if (ConnectorManager.HasCurrent)
            {
                // 決定中の接続がある場合は始点となっている場合, 既に接続済みである場合に非アクティブ
                // GUI.enabled = !ConnectorManager.IsConnected(this, position) && !ConnectorManager.IsCurrent(this, position);
                GUI.enabled = !ConnectorManager.IsCurrent(this, element);
                if (element == 0)
                {
                    if (GUI.Button(new Rect(rect.x - btnRect.x, rect.y + 40 + element * 25, btnRect.x, btnRect.y), ">"))
                    {
                        NodeArrow.cs.SlideOut();
                        NodeArrow.ps.SlideOut();
                        ConnectorManager.Connect(this, element);
                    }

                    /*
                     * if (GUI.Button(new Rect(rect.x + rect.width , rect.y + 40 + position*25, btnRect.x, btnRect.y), "<")){
                     *  Debug.Log("終点");
                     *  // クリックされたら接続
                     *  ConnectorManager.Connect(this, position);
                     * }*/
                }
                else
                {
                    if (GUI.Button(new Rect(rect.x + rect.width, rect.y + 40 + element * 25, btnRect.x, btnRect.y), ">"))
                    {
                        NodeArrow.cs.SlideOut();
                        NodeArrow.ps.SlideOut();
                        // クリックされたら取得
                        // 直前の始点と終点を結ぶ
                        ConnectorManager.StartConnecting(this, element);
                        // ConnectorManager.Connect(this, position);
                    }
                }
                GUI.enabled = true;
            }
            else
            {
                if (element == 0)
                {
                    if (GUI.Button(new Rect(rect.x - btnRect.x, rect.y + 40 + element * 25, btnRect.x, btnRect.y), ">"))
                    {
                        NodeArrow.cs.SlideOut();
                        NodeArrow.ps.SlideOut();
                        if (ConnectorManager.IsConnected(this, element))
                        {
                            ConnectorManager.Disconnect(this, element);
                        }
                        else
                        {
                            // Debug.Log("StartConnecting");
                            //ConnectorManager.Connect(this, position);
                            // ConnectorManager.StartConnecting(this, position);
                        }
                    }

                    /*
                     * if (GUI.Button(new Rect(rect.x + rect.width , rect.y + 40 + position*25, btnRect.x, btnRect.y), "<")){
                     * if (ConnectorManager.IsConnected(this, position))
                     * {
                     * Debug.Log("Disconnect");
                     * ConnectorManager.Disconnect(this, position);
                     * }
                     * else
                     * {
                     * Debug.Log("StartConnecting");
                     * //ConnectorManager.Connect(this, position);
                     * // ConnectorManager.StartConnecting(this, position);
                     * }
                     * }*/
                }
                else
                {
                    if (GUI.Button(new Rect(rect.x + rect.width, rect.y + 40 + element * 25, btnRect.x, btnRect.y), ">"))
                    {
                        NodeArrow.cs.SlideOut();
                        NodeArrow.ps.SlideOut();
                        if (ConnectorManager.IsConnected(this, element))
                        {
                            ConnectorManager.Disconnect(this, element);
                        }
                        else
                        {
                            ConnectorManager.StartConnecting(this, element);
                        }
                    }
                }
            }
        }
    }