Player Animation

The PlayerAnimation class is responsible for handling the animation states and transitions for player characters.

Properties

  • private PlayerWorker playerWorker: References the PlayerWorker associated with PlayerAnimation

  • public Animator animator: References Animator component attached to the player.

Constructor

  • public PlayerAnimation(PlayerWorker playerWorker): Initializes a new instance of the PlayerAnimation class, assigning the PlayerWorker and getting the Animator component from the player gameobject.

Methods

  • public void ResetAnimator(): Resets all animator parameters to their default state.

  • public void SetAnimation(AnimationType animationType, bool value): Sets the specified animation type to the provided boolean value.

  • public void PlayRotationAnimation(): Determines and plays the appropriate rotation animation based on the player's current rotation angle.

Last updated