Esempio n. 1
0
        public bool IsActionTriggering(AngleRangeAction action)
        {
            if (!IsActionActive(action))
            {
                return(false);
            }

            EventType eventType = Event.current.type;

            if (action == AngleRangeAction.RemoveRange)
            {
                if ((eventType == EventType.ValidateCommand || eventType == EventType.ExecuteCommand) &&
                    (Event.current.commandName == kSoftDeleteCommandName || Event.current.commandName == kDeleteCommandName))
                {
                    if (eventType == EventType.ExecuteCommand)
                    {
                        return(true);
                    }

                    Event.current.Use();
                }

                return(false);
            }

            return(eventType == EventType.MouseDown && Event.current.button == 0);
        }
Esempio n. 2
0
        public bool IsActionActive(AngleRangeAction action)
        {
            if (GUIUtility.hotControl != 0)
            {
                return(false);
            }

            if (action == AngleRangeAction.SelectRange)
            {
                return(HandleUtility.nearestControl == m_HoveredRangeID);
            }

            if (action == AngleRangeAction.ModifyRange)
            {
                return(HandleUtility.nearestControl == m_HoveredHandleID);
            }

            if (action == AngleRangeAction.CreateRange)
            {
                return(HandleUtility.nearestControl == m_CreateRangeControlID);
            }

            if (action == AngleRangeAction.ModifySelector)
            {
                return(HandleUtility.nearestControl == m_SelectorControlID);
            }

            if (action == AngleRangeAction.RemoveRange)
            {
                return(HasKeyboardFocus());
            }

            return(false);
        }
Esempio n. 3
0
        public bool IsActionFinishing(AngleRangeAction action)
        {
            if (!IsActionHot(action))
            {
                return(false);
            }

            return((Event.current.type == EventType.MouseUp && Event.current.button == 0) || Event.current.type == EventType.Ignore);
        }
Esempio n. 4
0
        public bool IsActionHot(AngleRangeAction action)
        {
            if (GUIUtility.hotControl == 0)
            {
                return(false);
            }

            if (action == AngleRangeAction.ModifyRange)
            {
                return(GUIUtility.hotControl == m_HotHandleID);
            }

            return(false);
        }