UnityEditor.TransformManipulator.EndEventCheck C# (CSharp) Method

EndEventCheck() private static method

private static EndEventCheck ( ) : EventType
return EventType
        private static EventType EndEventCheck()
        {
            EventType type = (s_EventTypeBefore == Event.current.GetTypeForControl(s_HotControl)) ? EventType.Ignore : s_EventTypeBefore;
            s_EventTypeBefore = EventType.Ignore;
            switch (type)
            {
                case EventType.MouseDown:
                    s_HotControl = GUIUtility.hotControl;
                    return type;

                case EventType.MouseUp:
                    s_HotControl = 0;
                    return type;
            }
            return type;
        }

Usage Example

        public static EventType EndManipulationHandling()
        {
            EventType eventType = TransformManipulator.EndEventCheck();

            if (eventType == EventType.MouseDown)
            {
                TransformManipulator.RecordMouseDownState(Selection.transforms);
                TransformManipulator.s_StartHandlePosition    = Tools.handlePosition;
                TransformManipulator.s_StartLocalHandleOffset = Tools.localHandleOffset;
                if (TransformManipulator.s_LockHandle)
                {
                    Tools.LockHandlePosition();
                }
                Tools.LockHandleRectRotation();
            }
            else if (TransformManipulator.s_MouseDownState != null && (eventType == EventType.MouseUp || GUIUtility.hotControl != TransformManipulator.s_HotControl))
            {
                TransformManipulator.s_MouseDownState = null;
                if (TransformManipulator.s_LockHandle)
                {
                    Tools.UnlockHandlePosition();
                }
                Tools.UnlockHandleRectRotation();
                ManipulationToolUtility.DisableMinDragDifference();
            }
            return(eventType);
        }