Example #1
0
        static void ShowWindow()
        {
            //uNodeEditor edit = EditorWindow.GetWindow<uNodeEditor>();
            uNodeEditor parent = ScriptableObject.CreateInstance <uNodeEditor>();

            parent.Show();
        }
Example #2
0
        public uNodeEdge(uNodeEditor parent, ConnectNode start, ConnectNode end = null)
        {
            parent.Contorols.Add(this);

            edgeStart    = start;
            edgeEnd      = end;
            parentWindow = parent;
        }
Example #3
0
        public uNodeEdge(uNodeEditor parent,ConnectNode start, ConnectNode end=null)
        {
            parent.Contorols.Add(this);

            edgeStart = start;
            edgeEnd = end;
            parentWindow = parent;
        }
Example #4
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="name"></param>
        public uDraggableNode(uNodeEditor parent, string name = "Node")
        {
            parent.Contorols.Add(this);

            parentWindow = parent;
            handle       = HandleIndex;
            windowRect   = CurrentPos;
            NodeName     = name;

            GUI.BringWindowToFront(handle);

            HandleIndex++;

            CurrentPos.position += new Vector2(64, 64);
            if (CurrentPos.x > parentWindow.position.width - CurrentPos.width)
            {
                CurrentPos.x = 0;
            }
            if (CurrentPos.y > parentWindow.position.height - CurrentPos.height)
            {
                CurrentPos.y = 0;
            }

            realWindowRect        = CurrentPos;
            realWindowRect.width  = WINDOW_DEFAULT_SIZE;
            realWindowRect.height = WINDOW_DEFAULT_SIZE;

            // 現在のズーム割合からサイズ算出
            windowRect.width  = realWindowRect.width * parentWindow.Grid.m_GridZoomRate;
            windowRect.height = realWindowRect.height * parentWindow.Grid.m_GridZoomRate;


            AddConnectBox(new ConnectBox(ConnectAreaType.AREA_LEFT, "in"));
            AddConnectBox(new ConnectBox(ConnectAreaType.AREA_RIGHT, "out"));
            AddConnectBox(new ConnectBox(ConnectAreaType.AREA_RIGHT, "out"));

            //AddConnectBox(new ConnectBox(ConnectAreaType.AREA_TOP, "in"));
            //AddConnectBox(new ConnectBox(ConnectAreaType.AREA_BOTTOM, "out"));
        }
Example #5
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="name"></param>
        public uDraggableNode(uNodeEditor parent, string name = "Node")
        {
            parent.Contorols.Add(this);

            parentWindow = parent;
            handle = HandleIndex;
            windowRect = CurrentPos;
            NodeName = name;

            GUI.BringWindowToFront(handle);

            HandleIndex++;

            CurrentPos.position += new Vector2(64, 64);
            if (CurrentPos.x > parentWindow.position.width - CurrentPos.width)
            {
                CurrentPos.x = 0;
            }
            if (CurrentPos.y > parentWindow.position.height - CurrentPos.height)
            {
                CurrentPos.y = 0;
            }

            realWindowRect = CurrentPos;
            realWindowRect.width = WINDOW_DEFAULT_SIZE;
            realWindowRect.height = WINDOW_DEFAULT_SIZE;

            // 現在のズーム割合からサイズ算出
            windowRect.width = realWindowRect.width * parentWindow.Grid.m_GridZoomRate;
            windowRect.height = realWindowRect.height * parentWindow.Grid.m_GridZoomRate;

            AddConnectBox(new ConnectBox(ConnectAreaType.AREA_LEFT,"in"));
            AddConnectBox(new ConnectBox(ConnectAreaType.AREA_RIGHT,"out"));
            AddConnectBox(new ConnectBox(ConnectAreaType.AREA_RIGHT, "out"));

            //AddConnectBox(new ConnectBox(ConnectAreaType.AREA_TOP, "in"));
            //AddConnectBox(new ConnectBox(ConnectAreaType.AREA_BOTTOM, "out"));
        }