Пример #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;
        }
Пример #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)
 {
 }
Пример #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)
 {
 }
Пример #4
0
 private AudioSource(IAudioProvider provider, AudioGroup group)
 {
     _provider = provider;
     _group    = group;
 }
Пример #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)
 {
 }