Exemplo n.º 1
0
        public void OnRelease(VisorWidget.VisorRegion visorRegion)
        {
            switch (m_CurrentState)
            {
            case State.Idle:
            case State.Hover:
                break;

            case State.Grab:
                SetDesiredState(State.Idle);
                break;

            case State.Drag:
                if (
                    visorRegion == VisorWidget.VisorRegion.Right ||
                    visorRegion == VisorWidget.VisorRegion.TopRight ||
                    visorRegion == VisorWidget.VisorRegion.BottomRight ||
                    visorRegion == VisorWidget.VisorRegion.FrontRight
                    )
                {
                    ToggleVisuals();
                }

                SetDesiredState(State.Idle);
                break;
            }
        }
Exemplo n.º 2
0
 public void OnPress(VisorWidget.VisorRegion visorRegion)
 {
     if (m_CurrentState == State.Hover && visorRegion == VisorWidget.VisorRegion.Left)
     {
         SetDesiredState(State.Grab);
     }
 }
Exemplo n.º 3
0
        public void OnRegionEnter(VisorWidget.VisorRegion visorRegion)
        {
            // TODO: Make ambidextrous
            switch (visorRegion)
            {
            case VisorWidget.VisorRegion.Left:
                switch (m_CurrentState)
                {
                case State.Idle:
                    SetDesiredState(State.Hover);
                    break;

                case State.Drag:
                    SetDesiredState(State.Grab);
                    break;

                default:
                    break;
                }
                break;

            case VisorWidget.VisorRegion.Right:
            case VisorWidget.VisorRegion.TopRight:
            case VisorWidget.VisorRegion.BottomRight:
            case VisorWidget.VisorRegion.FrontRight:
                switch (m_CurrentState)
                {
                case State.Hover:
                    SetDesiredState(State.Idle);
                    break;

                case State.Grab:
                    SetDesiredState(State.Drag);
                    break;

                default:
                    break;
                }
                break;

            case VisorWidget.VisorRegion.None:
            default:
                switch (m_CurrentState)
                {
                case State.Hover:
                    SetDesiredState(State.Idle);
                    break;

                case State.Drag:
                    SetDesiredState(State.Grab);
                    break;
                }
                break;
            }
        }