Ejemplo n.º 1
0
        /// <summary>
        ///     Draw the Group Handle and do any maths
        /// </summary>
        /// <param name="name">Text name of the Servo</param>
        /// <param name="groupID">Index of the Group</param>
        /// <param name="servoID">Index of the Servo</param>
        internal static void DrawServoHandle(string name, int groupID, int servoID)
        {
            if (Disabled)
            {
                return;           //If the Drag and Drop is Disabled then just go back
            }
            //Draw the drag handle
            GUILayout.Label(ImgDragHandle);

            if (Event.current.type == EventType.Repaint)
            {
                //If its the repaint event then use GUILayoutUtility to get the location of the handle
                //And build the structure so we know where on the screen it is
                Servos.Add(name, groupID, servoID, GUILayoutUtility.GetLastRect(), WindowRect.width);
            }
        }