Пример #1
0
    public AudioClip Get(ESfxId id)
    {
        Debug.Assert(sfxSrcList.Count > 0, "No SFX Source Data!");

        if (sfxDic.Count == 0)
        {
            GenerateSfxDictionary();
        }

        return(sfxDic[id]);
    }
Пример #2
0
    public void SetGhostSoundClip(ESfxId id)
    {
        Debug.Log("Called");

        if (id == currentGhostSound)
        {
            return;
        }

        currentGhostSound = id;
        ghostSource.clip  = audioStorage.Get(id);
        ghostSource.Play();
    }
Пример #3
0
 public void PlaySound(ESfxId id)
 {
     if (id == ESfxId.Click && Time.timeScale == 0.0f)
     {
         Time.timeScale = 1.0f;
         AudioSource.PlayClipAtPoint(audioStorage.Get(id), Vector3.zero);
         Time.timeScale = 0.0f;
     }
     else
     {
         AudioSource.PlayClipAtPoint(audioStorage.Get(id), Vector3.zero);
     }
 }