Example #1
0
 /// <summary>
 /// Constructor of Vox.SoundNode. Used internally by the MixedSound class to create the sound, do not use it.
 /// </summary>
 /// <remarks>
 /// Constructor of Vox.SoundNode. Used internally by the MixedSound class to create the sound, do not use it. To create SoundNode use the MixedSound class.
 /// </remarks>
 public SoundNode(VoxAudioSource p_voxSource, AudioClip p_clip, bool p_loop, float p_volume, SoundLayerType p_layer, int p_id)
 {
     this._id         = p_id;
     this._nodeVolume = p_volume;
     this._voxSource  = p_voxSource;
     this._voxSource.audioSource.clip   = p_clip;
     this._voxSource.audioSource.loop   = p_loop;
     this._voxSource.audioSource.volume = p_volume;
     this.soundLayer = p_layer;
 }
Example #2
0
        /// <summary>
        /// Constructor of Vox.SoundNode. Used internally by the MixedSound class to create the sound, do not use it.
        /// </summary>
        /// <remarks>
        /// Constructor of Vox.SoundNode. Used internally by the MixedSound class to create the sound, do not use it. To create SoundNode use the MixedSound class.
        /// </remarks>
        public SoundNode(VoxAudioSource p_voxSource, AudioClip p_clip, bool p_loop, float p_volume, string p_parentMixerName, string p_outgroupName, int p_id)
        {
            this._id         = p_id;
            this._nodeVolume = p_volume;
            this._voxSource  = p_voxSource;
            this._voxSource.audioSource.clip   = p_clip;
            this._voxSource.audioSource.loop   = p_loop;
            this._voxSource.audioSource.volume = p_volume;

            foreach (AudioMixer __mixer in SoundModule.instance.listAudioMixers)
            {
                if (__mixer.name == p_parentMixerName)
                {
                    this._voxSource.audioSource.outputAudioMixerGroup = __mixer.FindMatchingGroups(p_outgroupName)[0];
                    break;
                }
            }
        }