Exemple #1
0
        /// <summary>
        /// Applies options
        /// </summary>
        /// <param name="options"></param>
        public void ApplyOptions(AudioOption[] options)
        {
            if (options != null)
            {
                int len = options.Length;
                for (int i = 0; i < len; i++)
                {
                    AudioOption option = options[i];
                    switch (option.Type)
                    {
                    case AudioOptionType.AudioClip:
                        AudioClip = (AudioClip)option.Value;
                        break;

                    case AudioOptionType.Loop:
                        Loop = (bool)option.Value;
                        break;

                    case AudioOptionType.MaxVolume:
                        MaxDistance = (float)option.Value;
                        break;

                    case AudioOptionType.MinVolume:
                        MinDistance = (float)option.Value;
                        break;

                    case AudioOptionType.Pitch:
                        Pitch = (float)option.Value;
                        break;

                    case AudioOptionType.PitchRandomness:
                        PitchRandomness = (float)option.Value;
                        break;

                    case AudioOptionType.RolloffFactor:
                        RolloffMode = (AudioRolloffMode)option.Value;
                        break;

                    case AudioOptionType.Volume:
                        Volume = (float)option.Value;
                        break;
                    }
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Applies options
        /// </summary>
        /// <param name="options"></param>
        public void ApplyOptions(AudioOption[] options)
        {
            if (options != null)
            {
                int len = options.Length;
                for (int i = 0; i < len; i++)
                {
                    AudioOption option = options[i];
                    switch (option.Type)
                    {
                        case AudioOptionType.AudioClip:
                            AudioClip = (AudioClip)option.Value;
                            break;

                        case AudioOptionType.Loop:
                            Loop = (bool)option.Value;
                            break;

                        case AudioOptionType.MaxVolume:
                            MaxDistance = (float)option.Value;
                            break;

                        case AudioOptionType.MinVolume:
                            MinDistance = (float)option.Value;
                            break;

                        case AudioOptionType.Pitch:
                            Pitch = (float)option.Value;
                            break;

                        case AudioOptionType.PitchRandomness:
                            PitchRandomness = (float)option.Value;
                            break;

                        case AudioOptionType.RolloffFactor:
                            RolloffMode = (AudioRolloffMode) option.Value;
                            break;

                        case AudioOptionType.Volume:
                            Volume = (float)option.Value;
                            break;
                    }
                }
            }
        }