static void ShowWindow() { //uNodeEditor edit = EditorWindow.GetWindow<uNodeEditor>(); uNodeEditor parent = ScriptableObject.CreateInstance <uNodeEditor>(); parent.Show(); }
public uNodeEdge(uNodeEditor parent, ConnectNode start, ConnectNode end = null) { parent.Contorols.Add(this); edgeStart = start; edgeEnd = end; parentWindow = parent; }
public uNodeEdge(uNodeEditor parent,ConnectNode start, ConnectNode end=null) { parent.Contorols.Add(this); edgeStart = start; edgeEnd = end; parentWindow = parent; }
/// <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")); }
/// <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")); }