Class SoundManager
- Namespace
- VoxelPlayground.Sound
- Assembly
- GamePlay.dll
public class SoundManager : SerializedMonoBehaviour
- Inheritance
-
object
SerializedMonoBehaviour
SoundManager
- Extension Methods
-
Fields
_debug_DrawGizmos_PlaySound
[ShowInInspector]
[SuffixLabel("Debug", false)]
public static bool _debug_DrawGizmos_PlaySound
Field Value
- bool
masterAMGroup
public AudioMixerGroup masterAMGroup
Field Value
- AudioMixerGroup
musicAMGroup
public AudioMixerGroup musicAMGroup
Field Value
- AudioMixerGroup
musicAudioSource
public AudioSource musicAudioSource
Field Value
- AudioSource
musicVolume
[HideInInspector]
public float musicVolume
Field Value
- float
SFXAMGroup
public AudioMixerGroup SFXAMGroup
Field Value
- AudioMixerGroup
soundEffectClipsDic
public Dictionary<string, SoundEffect> soundEffectClipsDic
Field Value
- Dictionary<string, SoundEffect>
soundEffectPairs
public BlockInfo soundEffectPairs
Field Value
- BlockInfo
soundEffectVolume
[HideInInspector]
public float soundEffectVolume
Field Value
- float
UIAMGroup
public AudioMixerGroup UIAMGroup
Field Value
- AudioMixerGroup
Properties
Instance
public static SoundManager Instance { get; }
Property Value
- SoundManager
Methods
Awake()
protected virtual void Awake()
EnableFollow(SoundEvent, bool)
public void EnableFollow(SoundEvent se, bool follow)
Parameters
se SoundEvent
follow bool
GetSoundEffectByID(uint, SoundEffectType)
public SoundEffect GetSoundEffectByID(uint blockID, SoundEffectType soundType)
Parameters
blockID uint
soundType SoundEffectType
Returns
- SoundEffect
GetSoundEvent(string)
public SoundEvent GetSoundEvent(string soundEffectName)
Parameters
soundEffectName string
Returns
- SoundEvent
public bool IsPlaying(SoundEvent soundEvent, Transform owner)
Parameters
soundEvent SoundEvent
owner Transform
Returns
- bool
public bool IsPlaying(string soundEffectName, Transform owner)
Parameters
soundEffectName string
owner Transform
Returns
- bool
Mute()
[Button]
public void Mute()
PlayCollisionSoundEvent(SoundEffect, Vector3, SoundMixerType, float)
public void PlayCollisionSoundEvent(SoundEffect soundEffect, Vector3 position, SoundManager.SoundMixerType soundMixerType = SoundMixerType.SFX, float volumeFactor = 1)
Parameters
soundEffect SoundEffect
position Vector3
soundMixerType SoundManager.SoundMixerType
volumeFactor float
public void PlayPersistentSound(string soundEffectName, Transform owner, Vector3 position, SoundManager.SoundMixerType soundMixerType = SoundMixerType.SFX, SoundParameterIntensity intensity = null)
Parameters
soundEffectName string
owner Transform
position Vector3
soundMixerType SoundManager.SoundMixerType
intensity SoundParameterIntensity
PlaySFX_BulletHit(uint, Vector3, float)
public void PlaySFX_BulletHit(uint blockID, Vector3 pos, float volumeFactor = 0.33)
Parameters
blockID uint
pos Vector3
volumeFactor float
public void PlaySound_BulletHit(Transform rb, Vector3 pos, float volumeFactor = 0.33, uint blockId = 0)
Parameters
rb Transform
pos Vector3
volumeFactor float
blockId uint
PlaySound(SoundEvent, Vector3, float, SoundMixerType)
public void PlaySound(SoundEvent soundEvent, Vector3 position, float volumeFactor = 1, SoundManager.SoundMixerType soundMixerType = SoundMixerType.SFX)
Parameters
soundEvent SoundEvent
position Vector3
volumeFactor float
soundMixerType SoundManager.SoundMixerType
PlaySound(uint, SoundEffectType, Vector3, float, SoundTag, SoundEffectType)
public void PlaySound(uint blockId, SoundEffectType soundType, Vector3 position, float volumeFactor = 1, SoundTag soundTag = null, SoundEffectType fallbackSoundType = SoundEffectType.Generic)
Parameters
blockId uint
soundType SoundEffectType
position Vector3
volumeFactor float
soundTag SoundTag
fallbackSoundType SoundEffectType
PlaySoundEffectByID(uint, SoundEffectType, Vector3, float)
public void PlaySoundEffectByID(uint blockID, SoundEffectType soundType, Vector3 position, float volumeFactor = 1)
Parameters
blockID uint
soundType SoundEffectType
position Vector3
volumeFactor float
public void PlaySoundEvent(SoundEvent soundEvent, Transform owner, SoundManager.SoundMixerType soundMixerType = SoundMixerType.SFX, SoundParameterIntensity intensity = null)
Parameters
soundEvent SoundEvent
owner Transform
soundMixerType SoundManager.SoundMixerType
intensity SoundParameterIntensity
public void PlaySoundEventAtPosition(SoundEvent soundEvent, Transform owner, Vector3 position, SoundManager.SoundMixerType soundMixerType = SoundMixerType.SFX, SoundParameterIntensity intensity = null)
Parameters
soundEvent SoundEvent
owner Transform
position Vector3
soundMixerType SoundManager.SoundMixerType
intensity SoundParameterIntensity
public void PlaySoundOneShotAt(string soundEffectName, Vector3 position, SoundManager.SoundMixerType soundMixerType = SoundMixerType.SFX, Transform follow = null, SoundParameterIntensity intensity = null)
Parameters
soundEffectName string
position Vector3
soundMixerType SoundManager.SoundMixerType
follow Transform
intensity SoundParameterIntensity
PopAllBgmEvents()
public void PopAllBgmEvents()
PopBgmEvent(BgmEvent)
public void PopBgmEvent(BgmEvent record)
Parameters
record BgmEvent
PushBgmEvent(BgmEvent)
public void PushBgmEvent(BgmEvent record)
Parameters
record BgmEvent
SetMixerPitch(float)
[Button]
public void SetMixerPitch(float scale)
Parameters
scale float
SetVolume(SoundMixerType, float)
[Button]
public void SetVolume(SoundManager.SoundMixerType soundMixerType, float volume)
Parameters
soundMixerType SoundManager.SoundMixerType
volume float
public void StopAllSoundEventOwner(Transform owner)
Parameters
owner Transform
public void StopPersistentSound(string soundEffectName, Transform owner)
Parameters
soundEffectName string
owner Transform
public void StopSoundEvent(SoundEvent soundEvent, Transform owner = null)
Parameters
soundEvent SoundEvent
owner Transform
UnMute()