Skip to main content

SoundEffectSet

A class in Root.Township, the global namespace.

A ScriptableObject pairing a SoundEffect type with a Wwise event. Plays through the AudioManager singleton, so it only makes sound where audio runs.

Constructors​

MemberWhat it is
SoundEffectSet()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

2 private and internal fields
MemberWhat it is
private SoundEffect soundEffectTypeWhich kind of sound effect this is.
private Event soundEventThe Wwise event played.

Properties​

MemberWhat it is
SoundEffect SoundEffectType { get; }The SoundEffect value this set is for.
Event SoundEvent { get; }The Wwise event to post.

Methods​

MemberWhat it is
void Play()Plays the sound with no position.
void PlayAtObject(Component position)Plays the sound at a component's current position, tied to its game object.
void PlayAtPosition(Vector3 position)Plays the sound at a world position. The rotation overload ignores the rotation.
void PlayAtPosition(Vector3 position, Quaternion rotation)Plays the sound at a world position. The rotation overload ignores the rotation.
void PlayOnObject(Component position)Plays the sound attached to a component's game object, or to a player's controller.
void PlayOnObject(IPlayer position)Plays the sound attached to a component's game object, or to a player's controller.

Used in​

Members of other types that take, return or hold a SoundEffectSet:

Smelter.smelterActiveAudio, Smelter.whistleAudio, RecipePlacer.changePieceAudio, RecipePlacer.startWorkingAudio, RecipePlacer.stopWorkingAudio, TimberBlock.destroyingSound, TimberBlock.hittingSound, TimberPieceBase.hittingSound, CaveTeleportSettings.teleportSoundEffect, CaveTeleportSettings.TeleportSoundEffect, WaterfallEffectGenerator.soundEffect, ImpactDetectorSettings.ImpactSettings.soundEffectSet, ImpactDetectorSettings.ImpactSettings.SoundEffectSet, ImpactModifierComponent.defaultSound, ImpactModifierComponent.SoundEffect, AnimationBasedSound.clips, BookPageInstance.duplicatePageSound, BookPageInstance.removePageSound, DownedState.CanPlaySfx, DownedState.PlaySoundEffectForPlayer, SpiritState.CanPlaySfx, SpiritState.PlaySoundEffectForPlayer, SpiritStateSettings.enterSpiritModeSfx, SpiritStateSettings.EnterSpiritModeSfx, SpiritStateSettings.exitSpiritModeSfx, SpiritStateSettings.ExitSpiritModeSfx, AnalyticalButton.pressedSound, AnalyticalButton.releasedSound, DownedStateSettings.enterDownedStateSfx, DownedStateSettings.EnterDownedStateSfx, DownedStateSettings.exitDownedStateSfx, DownedStateSettings.ExitDownedStateSfx, IRespawnSystemSettings.ShrineDeactivationSfx, IRespawnSystemSettings.ShrineSubscribeSfx, RespawnShrine.CanPlaySfx, RespawnShrine.PlaySoundEffectForPlayer, RespawnSystemSettings.shrineDeactivationSfx, RespawnSystemSettings.ShrineDeactivationSfx, RespawnSystemSettings.shrineSubscribeSfx, RespawnSystemSettings.ShrineSubscribeSfx, AudioManager.GetSoundEventObject, AudioManager.IsAudioValid, AudioManager.IsValidSoundCallThisFrame, AudioManager.PlayInternal, AudioManager.PlayInternalOneShot, AudioManager.PlaySoundEffect, AudioManager.PlaySoundEffectAt, AudioManager.PlaySoundEffectOnObject, AudioManager.Resolve, AudioManager.soundEffectCallerIds, Bellows.bellowSound, ButtonSoundSettings.onPressed, ButtonSoundSettings.onReleased, DurabilityGlobalSettings.defaultStateChangeSound, DurabilityGlobalSettings.DefaultStateChangeSound, DurabilityModule.overrideStateChangeSound, SpiritModeDoorway.spiritDoorPassSfx, LoopingSoundEffect.loopSoundEffect, PhysicalButton.defaultSoundEffectSet, PhysicalButton.DefaultSoundEffectSet and 27 more.