public static void StopLoopingSound(this AudioSource audioSource) { if (CheckAudioSourceAndClip(audioSource)) { SoundManager2.StopLoopingSound(audioSource); } }
public static void PlayLoopingMusic(this AudioSource audioSource, float volume = 1) { if (audioSource != null) { SoundManager2.PlayLoopingMusic(audioSource, volume); } }
public static void PlayLoopingSound(this AudioSource audioSource, Vector3 position, float volume = 1) { if (CheckAudioSourceAndClip(audioSource)) { SoundManager2.PlayLoopingSound(audioSource, audioSource.clip, volume, position, true); } }
public static void PlaySound(this AudioSource audioSource, Vector3 position, AudioRolloffMode audioRollofMode, float spatialBlend = 1, float volume = 1) { if (CheckAudioSourceAndClip(audioSource)) { SoundManager2.PlaySound(audioSource, audioSource.clip, volume, position, true, spatialBlend, audioRollofMode); } }
public static void PlaySound(this AudioSource audioSource, float volume = 1) { Vector3 position = Vector3.zero; if (CheckAudioSourceAndClip(audioSource)) { SoundManager2.PlaySound(audioSource, audioSource.clip, volume, position, false, 0, AudioRolloffMode.Logarithmic); } }
public static void Instantiate() { if (instance != null) { Debug.LogWarning("Trying to instantiate SounManager, 2nd time"); return; } rootGo = new GameObject(); rootGo.name = "Sound Manager"; rootGo.hideFlags = HideFlags.DontSave; instance = rootGo.AddComponent <SoundManager2>(); DontDestroyOnLoad(rootGo); instantiated = true; }