Beispiel #1
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Volume control", EditorStyles.boldLabel);
            EditorGUILayout.Space();

            DrawScaleControl();

            EditorGUI.indentLevel += 1;

            CustomSliderDrawer.DrawSlider(m_spatialVolumeProp, m_currentScale);
            CustomSliderDrawer.DrawSlider(m_ambientVolumeProp, m_currentScale);
            CustomSliderDrawer.DrawSlider(m_reverbVolumeProp, m_currentScale);

            EditorGUI.indentLevel -= 1;

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Spatial effects control", EditorStyles.boldLabel);
            EditorGUILayout.Space();
            EditorGUIUtility.labelWidth = EditorGUIUtility.currentViewWidth * 3 / 4;

            EditorGUILayout.PropertyField(m_attenuationEnabledProp);
            EditorGUILayout.PropertyField(m_reflectionEnabledProp);
            EditorGUILayout.PropertyField(m_scatteringEnabledProp);
            EditorGUILayout.PropertyField(m_transmissionEnabledProp);
            EditorGUILayout.PropertyField(m_diffractionEnabledProp);
            EditorGUILayout.PropertyField(m_reverbEnabledProp);

            EditorGUIUtility.labelWidth = 0;

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Acoustic medium control", EditorStyles.boldLabel);
            EditorGUILayout.Space();

            EditorGUILayout.Slider(m_speedOfSoundProp, 100.0f, 1000.0f);

            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.PropertyField(m_dampingEnabledProp);

            EditorGUILayout.LabelField("Damping Coefficients", EditorStyles.label);
            EditorGUILayout.Space();

            EditorGUI.indentLevel += 1;
            EditorGUILayout.PropertyField(m_dampingCoefficientsProp, true);
            EditorGUI.indentLevel -= 1;

            for (int i = 0; i < 20; i++)
            {
                EditorGUILayout.Space();
            }

            serializedObject.ApplyModifiedProperties();
        }
        protected void DrawVolume()
        {
            if (!m_volumeProp.hasMultipleDifferentValues)
            {
                m_currentScale = (Scale)EditorGUILayout.EnumPopup(
                    new GUIContent("Volume scale", "Linear\nLogarithmic (dBFs)"),
                    m_currentScale);

                CustomSliderDrawer.DrawSlider(m_volumeProp, m_currentScale);
            }
            else
            {
                GUI.enabled = false;
                EditorGUILayout.EnumPopup("Volume scale", Scale.Linear);
                GUI.enabled = true;

                CustomSliderDrawer.DrawLinearSlider(m_volumeProp);
            }
        }
Beispiel #3
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUILayout.Space();

            EditorGUILayout.PropertyField(m_hrtfProp);

            DrawScaleControl();

            EditorGUI.indentLevel += 1;

            CustomSliderDrawer.DrawSlider(m_masterVolumeProp, m_currentScale);

            EditorGUI.indentLevel -= 1;

            EditorGUILayout.Space();

            EditorGUILayout.PropertyField(m_settingsProp);

            EditorGUILayout.Space();

            serializedObject.ApplyModifiedProperties();
        }