private IEnumerator StartGameDelayed() { var dc = Hub.Get <DepthController>(); dc.SetVisibilityOfUIFields(false); var spawner = Hub.Get <FishSpawner>(); //spawner.Spawn(1); yield return(new WaitForSeconds(startDelay)); isStarted = true; yield return(new WaitForSeconds(0.5f)); spawner.Spawn(spawner.SpawnCount, true); AudioController.Instance.PlaySound("splash"); dc.SetVisibilityOfUIFields(true); var audioId = AudioController.Instance.PlaySound("swarmloop"); _swarmLoopAudio = EazySoundManager.GetSoundAudio(audioId); }
public void PlaySound(Sounds sound) { if (soundsDictionary.TryGetValue(sound, out AudioClip audioClip)) { EazySoundManager.GetSoundAudio(EazySoundManager.PrepareSound(audioClip)).Play(); } }
public int PlaySound(AudioClip clip, float volume, bool loop = true, float pitch = 1, Transform sourceTransform = null) { if (!Application.isPlaying) { return(-1); } var id = EazySoundManager.PlaySound(clip, volume, loop, sourceTransform); var eazyAudio = EazySoundManager.GetSoundAudio(id); eazyAudio.Pitch = pitch; return(id); }