Beispiel #1
0
    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);
    }
Beispiel #2
0
 public void PlaySound(Sounds sound)
 {
     if (soundsDictionary.TryGetValue(sound, out AudioClip audioClip))
     {
         EazySoundManager.GetSoundAudio(EazySoundManager.PrepareSound(audioClip)).Play();
     }
 }
Beispiel #3
0
    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);
    }