Skip to main content

AnimationBasedSound

A class in Root.Township, Alta.Networking.Animation.

Plays sound effects from animation events. Sits next to an Animator; an animation event calls PlaySound with a clip index.

Constructors​

MemberWhat it is
AnimationBasedSound()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

2 private and internal fields
MemberWhat it is
private SoundEffectSet[] clipsThe sound effect sets to pick from.
private SoundEffect[] clipsToPlayObsolete list of single sound effects, kept as a fallback and migrated to clips.

Methods​

MemberWhat it is
void PlaySound(int clipIndex)Plays the sound at the given index at this object's position, using clips, or the old clipsToPlay list if clips is empty.