GetSpatializerPluginNames() private method

private GetSpatializerPluginNames ( ) : string[]
return string[]
Example #1
0
        public override void OnInspectorGUI()
        {
            this.serializedObject.Update();
            EditorGUILayout.PropertyField(this.m_Volume, AudioManagerInspector.Styles.Volume, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_RolloffScale, AudioManagerInspector.Styles.RolloffScale, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_DopplerFactor, AudioManagerInspector.Styles.DopplerFactor, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_DefaultSpeakerMode, AudioManagerInspector.Styles.DefaultSpeakerMode, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_SampleRate, AudioManagerInspector.Styles.SampleRate, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_DSPBufferSize, AudioManagerInspector.Styles.DSPBufferSize, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_VirtualVoiceCount, AudioManagerInspector.Styles.VirtualVoiceCount, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_RealVoiceCount, AudioManagerInspector.Styles.RealVoiceCount, new GUILayoutOption[0]);
            List <string> stringList = new List <string>((IEnumerable <string>)AudioUtil.GetSpatializerPluginNames());

            stringList.Insert(0, "None");
            string[]          array          = stringList.ToArray();
            List <GUIContent> guiContentList = new List <GUIContent>();

            foreach (string text in array)
            {
                guiContentList.Add(new GUIContent(text));
            }
            EditorGUI.BeginChangeCheck();
            int pluginStringIndex = this.FindPluginStringIndex(array, this.m_SpatializerPlugin.stringValue);
            int index             = EditorGUILayout.Popup(AudioManagerInspector.Styles.SpatializerPlugin, pluginStringIndex, guiContentList.ToArray(), new GUILayoutOption[0]);

            if (EditorGUI.EndChangeCheck())
            {
                this.m_SpatializerPlugin.stringValue = index != 0 ? array[index] : string.Empty;
            }
            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(this.m_DisableAudio, AudioManagerInspector.Styles.DisableAudio, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_VirtualizeEffects, AudioManagerInspector.Styles.VirtualizeEffects, new GUILayoutOption[0]);
            this.serializedObject.ApplyModifiedProperties();
        }
        public override void OnInspectorGUI()
        {
            base.serializedObject.Update();
            EditorGUILayout.PropertyField(this.m_Volume, AudioManagerInspector.Styles.Volume, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_RolloffScale, AudioManagerInspector.Styles.RolloffScale, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_DopplerFactor, AudioManagerInspector.Styles.DopplerFactor, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_DefaultSpeakerMode, AudioManagerInspector.Styles.DefaultSpeakerMode, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_SampleRate, AudioManagerInspector.Styles.SampleRate, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_DSPBufferSize, AudioManagerInspector.Styles.DSPBufferSize, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_VirtualVoiceCount, AudioManagerInspector.Styles.VirtualVoiceCount, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_RealVoiceCount, AudioManagerInspector.Styles.RealVoiceCount, new GUILayoutOption[0]);
            List <string> list = new List <string>(AudioUtil.GetSpatializerPluginNames());

            list.Insert(0, "None");
            string[]          array = list.ToArray();
            List <GUIContent> list2 = new List <GUIContent>();

            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string text = array2[i];
                list2.Add(new GUIContent(text));
            }
            EditorGUI.BeginChangeCheck();
            int num = this.FindPluginStringIndex(array, this.m_SpatializerPlugin.stringValue);

            num = EditorGUILayout.Popup(AudioManagerInspector.Styles.SpatializerPlugin, num, list2.ToArray(), new GUILayoutOption[0]);
            if (EditorGUI.EndChangeCheck())
            {
                if (num == 0)
                {
                    this.m_SpatializerPlugin.stringValue = string.Empty;
                }
                else
                {
                    this.m_SpatializerPlugin.stringValue = array[num];
                }
            }
            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(this.m_DisableAudio, AudioManagerInspector.Styles.DisableAudio, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_VirtualizeEffects, AudioManagerInspector.Styles.VirtualizeEffects, new GUILayoutOption[0]);
            base.serializedObject.ApplyModifiedProperties();
        }
        public override void OnInspectorGUI()
        {
            base.serializedObject.Update();
            EditorGUILayout.PropertyField(this.m_Volume, Styles.Volume, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_RolloffScale, Styles.RolloffScale, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_DopplerFactor, Styles.DopplerFactor, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_DefaultSpeakerMode, Styles.DefaultSpeakerMode, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_SampleRate, Styles.SampleRate, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_DSPBufferSize, Styles.DSPBufferSize, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_VirtualVoiceCount, Styles.VirtualVoiceCount, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_RealVoiceCount, Styles.RealVoiceCount, new GUILayoutOption[0]);
            List <string> list = new List <string>(AudioUtil.GetSpatializerPluginNames());

            list.Insert(0, "None");
            string[]          strs  = list.ToArray();
            List <GUIContent> list2 = new List <GUIContent>();

            foreach (string str in strs)
            {
                list2.Add(new GUIContent(str));
            }
            EditorGUI.BeginChangeCheck();
            int selectedIndex = this.FindPluginStringIndex(strs, this.m_SpatializerPlugin.stringValue);

            selectedIndex = EditorGUILayout.Popup(Styles.SpatializerPlugin, selectedIndex, list2.ToArray(), new GUILayoutOption[0]);
            if (EditorGUI.EndChangeCheck())
            {
                if (selectedIndex == 0)
                {
                    this.m_SpatializerPlugin.stringValue = "";
                }
                else
                {
                    this.m_SpatializerPlugin.stringValue = strs[selectedIndex];
                }
            }
            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(this.m_DisableAudio, Styles.DisableAudio, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_VirtualizeEffects, Styles.VirtualizeEffects, new GUILayoutOption[0]);
            base.serializedObject.ApplyModifiedProperties();
        }