Class AnimationEventHandler
- Namespace
- WitShells.ThirdPersonControl
Handles animation events for the third-person character. Attach to the GameObject with the Animator component.
public class AnimationEventHandler : MonoBehaviour
- Inheritance
-
AnimationEventHandler
Methods
OnFootStep(AnimationEvent)
Called by animation event on footstep frames.
public void OnFootStep(AnimationEvent animationEvent)
Parameters
animationEventAnimationEvent
OnJump(AnimationEvent)
Called by animation event when jumping.
public void OnJump(AnimationEvent animationEvent)
Parameters
animationEventAnimationEvent
OnJump(InputValue)
Overload to handle PlayerInput SendMessages callback. This prevents MissingMethodException when PlayerInput broadcasts OnJump.
public void OnJump(UnityEngine.InputSystem.InputValue value)
Parameters
valueInputValue
OnLand(AnimationEvent)
Called by animation event when landing.
public void OnLand(AnimationEvent animationEvent)
Parameters
animationEventAnimationEvent
PlaySound(AnimationEvent)
Generic method to play any sound from animation events. Pass the AudioClip as the objectReferenceParameter in the animation event.
public void PlaySound(AnimationEvent animationEvent)
Parameters
animationEventAnimationEvent
SetSettings(ThirdPersonSettings)
Set the settings object at runtime.
public void SetSettings(ThirdPersonSettings newSettings)
Parameters
newSettingsThirdPersonSettings
SetSoundEffects(SoundSfxObject)
Set the sound effects object at runtime.
public void SetSoundEffects(SoundSfxObject sfx)
Parameters
sfxSoundSfxObject