コード例 #1
0
    public override void Enable(PlayerMotor callingObject)
    {
        Disable();
        userCoolingDown = false;
        PlayerInputManager.GetAxisFromString(InputAxis).onKey       += HorizontalPressed;
        PlayerInputManager.GetAxisFromString(InputLaunch).onKeyDown += LaunchPressed;
        PlayerInputManager.GetAxisFromString(InputJump).onKeyDown   += JumpPressed;
        userLaunch = false;
        userJump   = false;

        if (runBefore)
        {
            return;
        }

        callingObject.ActiveCoroutines.Add(callingObject.StartRoutine(InputSession()));
        runBefore = true;
    }
コード例 #2
0
 public void Disable()
 {
     PlayerInputManager.GetAxisFromString(InputAxis).onKey       -= HorizontalPressed;
     PlayerInputManager.GetAxisFromString(InputLaunch).onKeyDown -= LaunchPressed;
     PlayerInputManager.GetAxisFromString(InputJump).onKeyDown   -= JumpPressed;
 }