示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#4
0
        public bool IsActionHot(AngleRangeAction action)
        {
            if (GUIUtility.hotControl == 0)
            {
                return(false);
            }

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

            return(false);
        }