Last active
August 25, 2022 02:08
-
-
Save curious-username/912f273ea6b7bcce457608eba91c18e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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