Ejemplo n.º 1
0
        public static float DoInitialModule(AudioMixerGroupController group, AudioMixerController controller, List <AudioMixerGroupController> allGroups)
        {
            Rect  rect          = EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins, new GUILayoutOption[0]);
            float valueForPitch = group.GetValueForPitch(controller, controller.TargetSnapshot);

            if (AudioMixerEffectGUI.Slider(AudioMixerEffectView.Texts.pitch, ref valueForPitch, 100f, 1f, AudioMixerEffectView.Texts.percentage, 0.01f, 10f, controller, new AudioGroupParameterPath(group, group.GetGUIDForPitch()), new GUILayoutOption[0]))
            {
                group.SetValueForPitch(controller, controller.TargetSnapshot, valueForPitch);
            }
            GUILayout.Space(5f);
            EditorGUILayout.EndVertical();
            AudioMixerDrawUtils.DrawSplitter();
            return(rect.height);
        }
        public static float DoInitialModule(AudioMixerGroupController group, AudioMixerController controller, List <AudioMixerGroupController> allGroups)
        {
            Rect totalRect = EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins);

            // Pitch
            float value = group.GetValueForPitch(controller, controller.TargetSnapshot);

            if (AudioMixerEffectGUI.Slider(Texts.pitch, ref value, 100.0f, 1.0f, Texts.percentage, kMinPitch, kMaxPitch, controller, new AudioGroupParameterPath(group, group.GetGUIDForPitch())))
            {
                Undo.RecordObject(controller.TargetSnapshot, "Change Pitch");
                group.SetValueForPitch(controller, controller.TargetSnapshot, value);
            }

            GUILayout.Space(5f);
            EditorGUILayout.EndVertical();

            AudioMixerDrawUtils.DrawSplitter();

            return(totalRect.height);
        }