Raymond Maarloeve
Loading...
Searching...
No Matches
footstep_manager_npc Class Reference

Handles footstep sounds for NPCs during animation states using StateMachineBehaviour. Plays two footstep sounds at specified points in the animation loop. More...

Public Member Functions

override void OnStateEnter (Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 Called when the animation state is entered. Resets internal state and loads footstep audio clips.
 
override void OnStateUpdate (Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 Called every frame the animation state is active. Plays footstep sounds based on animation progress.
 
override void OnStateExit (Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 Called when the animation state is exited. Resets internal state.
 

Public Attributes

bool running = false
 If true, run footstep sounds are used instead of walk sounds.
 
float firstFootstepPercent_float = 0.30f
 Percentage of animation duration when the first footstep should occur.
 
float secondFootstepPercent_float = 0.81f
 Percentage of animation duration when the second footstep should occur.
 

Detailed Description

Handles footstep sounds for NPCs during animation states using StateMachineBehaviour. Plays two footstep sounds at specified points in the animation loop.

Member Function Documentation

◆ OnStateEnter()

override void footstep_manager_npc.OnStateEnter ( Animator  animator,
AnimatorStateInfo  stateInfo,
int  layerIndex 
)

Called when the animation state is entered. Resets internal state and loads footstep audio clips.

Parameters
animatorThe Animator playing the state.
stateInfoInformation about the current state.
layerIndexThe layer index the state is playing on.

◆ OnStateExit()

override void footstep_manager_npc.OnStateExit ( Animator  animator,
AnimatorStateInfo  stateInfo,
int  layerIndex 
)

Called when the animation state is exited. Resets internal state.

Parameters
animatorThe Animator playing the state.
stateInfoInformation about the current state.
layerIndexThe layer index the state is playing on.

◆ OnStateUpdate()

override void footstep_manager_npc.OnStateUpdate ( Animator  animator,
AnimatorStateInfo  stateInfo,
int  layerIndex 
)

Called every frame the animation state is active. Plays footstep sounds based on animation progress.

Parameters
animatorThe Animator playing the state.
stateInfoInformation about the current state.
layerIndexThe layer index the state is playing on.

Member Data Documentation

◆ firstFootstepPercent_float

float footstep_manager_npc.firstFootstepPercent_float = 0.30f

Percentage of animation duration when the first footstep should occur.

◆ running

bool footstep_manager_npc.running = false

If true, run footstep sounds are used instead of walk sounds.

◆ secondFootstepPercent_float

float footstep_manager_npc.secondFootstepPercent_float = 0.81f

Percentage of animation duration when the second footstep should occur.


The documentation for this class was generated from the following file: