示例#1
0
 public void PlayClip(string SoundName, float pos)
 {
     for (int i = 0; i < this.sounds.Length; i++)
     {
         if (this.sounds[i].soundName == SoundName && Time.unscaledTime - this.sounds[i].timeSinceLastPlay > 0.05f)
         {
             Sfx component = PoolManager.instance.GetObject("Sfx", base.transform.position, Quaternion.identity).GetComponent <Sfx>();
             component.InitSfx(this.sounds[i].clips[UnityEngine.Random.Range(0, this.sounds[i].clips.Length)], UnityEngine.Random.Range(this.sounds[i].pitchRange.x, this.sounds[i].pitchRange.y), this.sounds[i].vol, pos, this.sounds[i].mixer);
             this.sounds[i].timeSinceLastPlay = Time.unscaledTime;
         }
     }
 }