コード例 #1
0
ファイル: GameController.cs プロジェクト: Kruemelkatze/Swarm
    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);
    }
コード例 #2
0
 public void PlaySound(Sounds sound)
 {
     if (soundsDictionary.TryGetValue(sound, out AudioClip audioClip))
     {
         EazySoundManager.GetSoundAudio(EazySoundManager.PrepareSound(audioClip)).Play();
     }
 }
コード例 #3
0
ファイル: AudioController.cs プロジェクト: Kruemelkatze/Swarm
    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);
    }