static GUIDragAndDrop() { Groups = new GroupDetailsList(); Servos = new ServoDetailsList(); ImgDrag = new Texture2D(16, 16, TextureFormat.ARGB32, false); ImgDragHandle = new Texture2D(16, 16, TextureFormat.ARGB32, false); ImgDragInsert = new Texture2D(18, 9, TextureFormat.ARGB32, false); ImgBackground = new Texture2D(9, 9, TextureFormat.ARGB32, false); }
/// <summary> /// Called at Start of DrawWindow routine /// </summary> /// <param name="windowRect">Rect of the window</param> /// <param name="editorScroll">Scroll Position of the scroll window</param> internal static void WindowBegin(Rect windowRect, Vector2 editorScroll) { if (Disabled) { return; //If the Drag and Drop is Disabled then just go back } //store the Position of the mouse and window elements for use later MousePosition = new Vector2(Input.mousePosition.x - windowRect.x, Screen.height - Input.mousePosition.y - windowRect.y); ScrollPosition = editorScroll; WindowRect = windowRect; if (Event.current.type == EventType.Repaint) { lstGroups = new GroupDetailsList(); lstServos = new ServoDetailsList(); } rectScrollTop = new Rect(8, 30, windowRect.width - 25, 15); rectScrollBottom = new Rect(8, windowRect.height - 22, windowRect.width - 25, 15); }