public void PlayClip(AudioClip clip, Vector3 point, AudioSource template, float volume, float pitch)
        {
            int checkedIndices = 0;
            int i = lastAvailable;

            while (checkedIndices < TempAudioPoolSize)
            {
                PhysSoundTempAudio a = audioSources[i];

                if (!a.gameObject.activeInHierarchy)
                {
                    a.PlayClip(clip, point, template, volume, pitch);

                    lastAvailable = i;
                    return;
                }

                i++;
                checkedIndices++;

                if (i >= TempAudioPoolSize)
                {
                    i = 0;
                }
            }
        }
예제 #2
0
        // Token: 0x06003FFA RID: 16378 RVA: 0x00141CA0 File Offset: 0x001400A0
        public void PlayClip(AudioClip clip, Vector3 point, AudioSource template, float volume, float pitch)
        {
            int i   = 0;
            int num = this.lastAvailable;

            while (i < PhysSoundTempAudioPool.TempAudioPoolSize)
            {
                PhysSoundTempAudio physSoundTempAudio = this.audioSources[num];
                if (!physSoundTempAudio.gameObject.activeInHierarchy)
                {
                    physSoundTempAudio.PlayClip(clip, point, template, volume, pitch);
                    this.lastAvailable = num;
                    return;
                }
                num++;
                i++;
                if (num >= PhysSoundTempAudioPool.TempAudioPoolSize)
                {
                    num = 0;
                }
            }
        }