Esempio n. 1
0
        private AudioGroup(AudioGroup parentGroup, bool allowOrphan)
        {
            _sources       = new HashSet <AudioNode>();
            _sourcesRemove = new HashSet <AudioNode>();
            _sourcesAdd    = new HashSet <AudioNode>();

            // Set parent audio group
            if (!allowOrphan && parentGroup == null)
            {
                throw new ArgumentNullException(nameof(parentGroup));
            }
            Parent = parentGroup;
        }
Esempio n. 2
0
 /// <summary>
 /// Construct a new audio group that is connected to the specified parent group.
 /// </summary>
 /// <param name="parentGroup">The parent audio group.</param>
 public AudioGroup(AudioGroup parentGroup)
     : this(parentGroup, false)
 {
 }
Esempio n. 3
0
 /// <summary>
 /// Create an audio source for the given stream in the specified audio group.
 /// </summary>
 public AudioSource(Stream stream, AudioGroup group)
     : this(new AudioStreamProvider(stream), group)
 {
 }
Esempio n. 4
0
 private AudioSource(IAudioProvider provider, AudioGroup group)
 {
     _provider = provider;
     _group    = group;
 }
Esempio n. 5
0
 /// <summary>
 /// Create an audio source for the given clip in the specified audio group.
 /// </summary>
 public AudioSource(AudioClip clip, AudioGroup group)
     : this(new AudioClipProvider(clip), group)
 {
 }