예제 #1
0
        public void SetAnimParam(InputInfo handInput)
        {
            ClearAnimParam();
            if (handInput.directionEnum != InputDir.Middle)
            {
                int InputNum = (int)handInput.directionEnum;
                //将逻辑枚举拆分成
                switch (handInput.GetHoriEnum())
                {
                case InputDir.Left:
                    ActionCtrl.SetBool("Dir_Left", true);
                    break;

                case InputDir.Right:
                    ActionCtrl.SetBool("Dir_Right", true);
                    break;

                default:
                    ActionCtrl.SetBool("Dir_Right", false);
                    ActionCtrl.SetBool("Dir_Left", false);
                    break;
                }
                switch (handInput.GetVertEnum())
                {
                case InputDir.Up:
                    ActionCtrl.SetBool("Dir_Up", true);
                    break;

                case InputDir.Down:
                    ActionCtrl.SetBool("Dir_Down", true);
                    break;

                default:
                    ActionCtrl.SetBool("Dir_Up", false);
                    ActionCtrl.SetBool("Dir_Down", false);
                    break;
                }
            }
            switch (handInput.gesture)
            {
            case HandGesture.Click:
                ActionCtrl.SetBool("Hand_Click", true);
                break;

            case HandGesture.Drag:
                ActionCtrl.SetBool("Hand_Drag", true);
                break;

            case HandGesture.Slip:
                ActionCtrl.SetBool("Hand_Slip", true);
                break;

            case HandGesture.Holding:
                ActionCtrl.SetBool("Hand_Holding", true);
                break;

            case HandGesture.Realease:
                ActionCtrl.SetBool("Hand_Release", true);
                break;

            default:
                ActionCtrl.SetBool("Hand_Drag", false);
                ActionCtrl.SetBool("Hand_Click", false);
                ActionCtrl.SetBool("Hand_Slip", false);
                ActionCtrl.SetBool("Hand_Holding", false);
                break;
            }
        }