Exemple #1
0
        public VoxAudioSource GetFreeVoxAudioSource(AudioModelType p_model = AudioModelType.DEFAULT)
        {
            VoxAudioSource __source = this.listVoxSources.FirstOrDefault(__t => __t.state == AudioSourceState.FREE) ?? this.AddAudioSourceToList();

            __source.state = AudioSourceState.USED;
            __source.CopyAudioProperties(_dictAudioSourceModels[p_model]);

            return(__source);
        }
Exemple #2
0
        private VoxAudioSource AddAudioSourceToList()
        {
            GameObject __instance = new GameObject("VoxAudioSource " + this.listVoxSources.Count);

            __instance.transform.SetParent(audioSourceParent);

            VoxAudioSource __voxAudioSource = __instance.AddComponent <VoxAudioSource>( );

            __voxAudioSource.audioSource = __instance.AddComponent <AudioSource>( );
            this.listVoxSources.Add(__voxAudioSource);

            return(__voxAudioSource);
        }