Ejemplo n.º 1
0
 public static void StopLoopingSound(this AudioSource audioSource)
 {
     if (CheckAudioSourceAndClip(audioSource))
     {
         SoundManager2.StopLoopingSound(audioSource);
     }
 }
Ejemplo n.º 2
0
 public static void PlayLoopingMusic(this AudioSource audioSource, float volume = 1)
 {
     if (audioSource != null)
     {
         SoundManager2.PlayLoopingMusic(audioSource, volume);
     }
 }
Ejemplo n.º 3
0
 public static void PlayLoopingSound(this AudioSource audioSource, Vector3 position, float volume = 1)
 {
     if (CheckAudioSourceAndClip(audioSource))
     {
         SoundManager2.PlayLoopingSound(audioSource, audioSource.clip, volume, position, true);
     }
 }
Ejemplo n.º 4
0
 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);
     }
 }
Ejemplo n.º 5
0
        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);
            }
        }
Ejemplo n.º 6
0
        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;
        }