Class SFXManager
Class that handle all the SFX. Through its functions you can play a SFX of a given type at a given position.
It use pooling to pre-create all the source and recycle them for efficiency reason.
Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
SFXManager
Assembly: Assembly-CSharp.dll
Syntax
public class SFXManager : MonoBehaviour
Fields
DefaultHitSound
Declaration
public AudioClip[] DefaultHitSound
Field Value
Type |
Description |
UnityEngine.AudioClip[] |
|
DefaultItemEquipedSound
Declaration
public AudioClip DefaultItemEquipedSound
Field Value
Type |
Description |
UnityEngine.AudioClip |
|
DefaultItemUsedSound
Declaration
public AudioClip DefaultItemUsedSound
Field Value
Type |
Description |
UnityEngine.AudioClip |
|
DefaultPickupSound
Declaration
public AudioClip DefaultPickupSound
Field Value
Type |
Description |
UnityEngine.AudioClip |
|
DefaultSwingSound
Declaration
[Header("Defaults")]
public AudioClip[] DefaultSwingSound
Field Value
Type |
Description |
UnityEngine.AudioClip[] |
|
Listener
Declaration
public AudioListener Listener
Field Value
Type |
Description |
UnityEngine.AudioListener |
|
ListenerTarget
Declaration
public Transform ListenerTarget
Field Value
Type |
Description |
UnityEngine.Transform |
|
Properties
ItemEquippedSound
Declaration
public static AudioClip ItemEquippedSound { get; }
Property Value
Type |
Description |
UnityEngine.AudioClip |
|
ItemUsedSound
Declaration
public static AudioClip ItemUsedSound { get; }
Property Value
Type |
Description |
UnityEngine.AudioClip |
|
PickupSound
Declaration
public static AudioClip PickupSound { get; }
Property Value
Type |
Description |
UnityEngine.AudioClip |
|
Methods
GetDefaultHit()
Declaration
public static AudioClip GetDefaultHit()
Returns
Type |
Description |
UnityEngine.AudioClip |
|
GetDefaultSwingSound()
Declaration
public static AudioClip GetDefaultSwingSound()
Returns
Type |
Description |
UnityEngine.AudioClip |
|
GetSource(SFXManager.Use)
Get a source of the given type. You will rarely call this directly and instead use PlaySound.
Declaration
public static AudioSource GetSource(SFXManager.Use useType)
Parameters
Type |
Name |
Description |
SFXManager.Use |
useType |
The type of sound (map to a specific mixer)
|
Returns
Type |
Description |
UnityEngine.AudioSource |
The AudioSource at the front of the current pool queue for the given type
|
PlaySound(SFXManager.Use, SFXManager.PlayData)
Play a sound of the given type using the info in the given PlayData. This will take care of retrieving an
AudioSource of the given type
Declaration
public static void PlaySound(SFXManager.Use useType, SFXManager.PlayData data)
Parameters
Type |
Name |
Description |
SFXManager.Use |
useType |
The type of sound (map to a specific mixer)
|
SFXManager.PlayData |
data |
The PlayData that contains all the data of the sound to play (clip, volume, position etc.)
|