Skip to content

Instantly share code, notes, and snippets.

@curious-username
Last active August 25, 2022 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curious-username/912f273ea6b7bcce457608eba91c18e0 to your computer and use it in GitHub Desktop.
Save curious-username/912f273ea6b7bcce457608eba91c18e0 to your computer and use it in GitHub Desktop.
private void Awake()
{
_playerControls = new PlayerInputActions();
_bearAnim = GetComponent<Animator>();
}
private void OnEnable()
{
_movementActions = _playerControls.BearMovement.BearWalk;
_movementActions.Enable();
_switchActionMap = _playerControls.BearMovement.SwitchMap;
_switchActionMap.Enable();
_switchActionMap.performed += SwitchMap_performed;
_RecoverActions = _playerControls.BearRecovery.BearSleep;
}
private void SwitchMap_performed(InputAction.CallbackContext obj)
{
_movementActions.Disable();
_RecoverActions.Enable();
_RecoverActions.started += BearSleep;
}
private void OnDisable()
{
_movementActions.Disable();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment