Skip to main content

PlaySound

A class in Root.Township, the global namespace.

Animator state behaviour that plays a sound at the animated object when the state is entered, after an optional delay.

Constructors​

MemberWhat it is
PlaySound()Creates a PlaySound with default values.

Fields​

6 private and internal fields
MemberWhat it is
private float delaySeconds to wait before playing.
private float maxFalloffDistanceObsolete; now set on the sound effect set.
private float minFalloffDistanceObsolete; now set on the sound effect set.
private SoundEffect soundOld single sound, used to fill soundSet if that's empty.
private SoundEffectSet soundSetThe sound to play.
private float volumeObsolete; now set on the sound effect set.

Methods​

MemberWhat it is
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)Waits delay seconds, then plays soundSet at the animator's position.