Exemple #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;
        }
Exemple #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)
 {
 }
 /// <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)
 {
 }
 private AudioSource(IAudioProvider provider, AudioGroup group)
 {
     _provider = provider;
     _group    = group;
 }
 /// <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)
 {
 }