Player Input
The PlayerInput
class is responsible for handling and processing player inputs in the game.
Properties
public PlayerWorker playerWorker
: References thePlayerWorker
associated withPlayerInput
public PlayerInputs playerInputs
: References player input actions defined in Unity editor.public PlayerAttackInput playerAttackInput
: References thePlayerAttackInput
, which manages input specifically related to player attacks.public PlayerMovementInput playerMovementInput
: References thePlayerMovementInput
, which manages input specifically related to player movement.public PlayerRotationInput playerRotationInput
: References thePlayerRotationInput
, which manages input specifically related to player rotation.public Vector2 movementInput
: Represents the movement input vector given by player.public Vector2 cameraInput
: Represents the current camera input vector given by player.public bool leftButton
: Represents the state of the left action button.public bool rightButton
: Represents the state of the right action button.public bool interact
: Represents the state of the interact action button.
Constructor
public PlayerInput(PlayerWorker playerWorker)
: Initializes a new instance of thePlayerInput
class, assigning thePlayerWorker
Methods
public void OnUpdate()
: Updates the states ofPlayerAttackInput
,PlayerMovementInput
, andPlayerRotationInput
every frame.public void OnLateUpdate()
: Resets certain input states (leftButton
,interact
) in the late update.
Last updated