Exemplo n.º 1
0
 void unlockCtrl(UserInputManager.InputSource ctrl)
 {
     foreach (GameObject player in playerCollection)
     {
         UserInputManager Uinput = player.GetComponent <UserInputManager>();
         Uinput.UnlockControl(ctrl);
     }
 }
Exemplo n.º 2
0
    public bool CheckInputControl(UserInputManager.InputSource input)
    {
        bool returnV = false;

        if (inputDevice == null)
        {
            return(false);
        }
        switch (input)
        {
        case InputSource.LStick:
            if (inputDevice.LeftStickX != 0 && inputDevice.LeftStickY != 0)
            {
                returnV = true;
            }
            break;

        case InputSource.RStick:
            if (inputDevice.RightStickX != 0 && inputDevice.RightStickY != 0)
            {
                returnV = true;
            }
            break;

        case InputSource.LTrigger:
            if ((inputDevice.LeftStickX != 0 || inputDevice.LeftStickY != 0) && inputDevice.LeftTrigger.IsPressed)
            {
                returnV = true;
            }
            break;

        case InputSource.RTrigger:
            returnV = inputDevice.RightTrigger.WasPressed;
            break;

        case InputSource.LBumper:
            returnV = inputDevice.LeftBumper.WasPressed;
            break;

        case InputSource.RBumper:
            returnV = inputDevice.RightBumper.WasPressed;
            break;

        case InputSource.LtriggerAndRTrigger:
            if ((inputDevice.LeftStickX != 0 || inputDevice.LeftStickY != 0) && inputDevice.LeftTrigger.IsPressed)
            {
                returnV = inputDevice.RightTrigger.WasPressed;
            }
            break;

        default:
            returnV = false;
            break;
        }
        return(returnV);
    }
Exemplo n.º 3
0
    public bool CheckInputControl(UserInputManager.InputSource input)
    {
        bool returnV = false;

        if (inputDevice == null)
        {
            return(false);
        }
        switch (input)
        {
        case InputSource.LStick:
            if (inputDevice.LeftStickX != 0 && inputDevice.LeftStickY != 0)
            {
                returnV = true;
            }
            break;

        case InputSource.RStick:
            if (inputDevice.RightStickX != 0 && inputDevice.RightStickY != 0)
            {
                returnV = true;
            }
            break;

        case InputSource.LTrigger:
            if (animator.GetCurrentAnimatorStateInfo(0).IsName("Run"))
            {
                returnV = true;
            }
            break;

        case InputSource.RTrigger:
            returnV = inputDevice.RightTrigger.WasPressed;
            break;

        case InputSource.LBumper:
            returnV = inputDevice.LeftBumper.WasPressed;
            break;

        case InputSource.RBumper:
            returnV = inputDevice.RightBumper.WasPressed;
            break;

        case InputSource.LtriggerAndRTrigger:
            if (animator.GetCurrentAnimatorStateInfo(0).IsName("Run"))
            {
                returnV = inputDevice.RightTrigger.WasPressed;
            }
            break;

        default:
            returnV = false;
            break;
        }
        return(returnV);
    }
Exemplo n.º 4
0
 void updateHelper()
 {
     time                = Time.time;
     CurButton           = TutorialSteps [NumOfCurStep].button;
     _txt.text           = TutorialSteps[NumOfCurStep].txt;
     _txt2.text          = TutorialSteps[NumOfCurStep].txt;
     holdButton          = TutorialSteps[NumOfCurStep].hold;
     curInstructionInput = TutorialSteps [NumOfCurStep].inputSource;
     unlockCtrl(curInstructionInput);
 }