Player Input

The PlayerInput class is responsible for handling and processing player inputs in the game.

Properties

  • public PlayerWorker playerWorker: References the PlayerWorker associated with PlayerInput

  • public PlayerInputs playerInputs: References player input actions defined in Unity editor.

  • public PlayerAttackInput playerAttackInput: References the PlayerAttackInput, which manages input specifically related to player attacks.

  • public PlayerMovementInput playerMovementInput: References the PlayerMovementInput, which manages input specifically related to player movement.

  • public PlayerRotationInput playerRotationInput: References the PlayerRotationInput, 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 the PlayerInput class, assigning the PlayerWorker

Methods

  • public void OnUpdate(): Updates the states of PlayerAttackInput, PlayerMovementInput, and PlayerRotationInput every frame.

  • public void OnLateUpdate(): Resets certain input states (leftButton, interact) in the late update.

Last updated