Exemplo n.º 1
0
        public void PlayAudio()
        {
            if (_streamIndices.Count == 0)
            {
                PopulateStreamIndices();
            }

            if (_streamIndices.Count == 0)
            {
                return;
            }

            var idx = _streamIndices.Dequeue();

            GetChild <AudioStreamPlayer2D>(idx).PlayWithPitchRange(1f - _pitchDifference, 1f + _pitchDifference);

            if (_alwaysPlay != null)
            {
                _alwaysPlay.PlayWithPitchRange(1f - _pitchDifference, 1f + _pitchDifference);
            }
        }