Beispiel #1
0
        void DrawVisualizer()
        {
            if (EditorUtil.Foldout("Visualizer", false))
            {
                ++EditorGUI.indentLevel;

                drawOnEveryFrame = EditorGUILayout.Toggle("Draw On Every Frame", drawOnEveryFrame);

                if (EditorUtil.SimpleFoldout("Formant Map", true))
                {
                    ++EditorGUI.indentLevel;
                    EditorUtil.DrawFormants(profile, lipSync.result);
                    --EditorGUI.indentLevel;
                }

                EditorGUILayout.Separator();

                if (EditorUtil.SimpleFoldout("LPC Spectral Envelope", true))
                {
                    ++EditorGUI.indentLevel;
                    DrawLPCSpectralEnvelope();
                    --EditorGUI.indentLevel;
                }

                EditorGUILayout.Separator();

                --EditorGUI.indentLevel;
            }
        }
Beispiel #2
0
        public void Draw(bool drawTips, bool drawVisualizer)
        {
            serializedObject.Update();

            bool isDefaultAsset =
                profile.name == Common.defaultProfileMan ||
                profile.name == Common.defaultProfileWoman;

            if (EditorUtil.SimpleFoldout("Formant", true))
            {
                ++EditorGUI.indentLevel;
                DrawFormant(ref profile.formantA, "A", isDefaultAsset);
                DrawFormant(ref profile.formantI, "I", isDefaultAsset);
                DrawFormant(ref profile.formantU, "U", isDefaultAsset);
                DrawFormant(ref profile.formantE, "E", isDefaultAsset);
                DrawFormant(ref profile.formantO, "O", isDefaultAsset);
                EditorGUILayout.Separator();
                if (isDefaultAsset)
                {
                    EditorGUILayout.Separator();
                    EditorGUILayout.HelpBox("Cannot change parameters in a default asset.", MessageType.Info);
                }
                else
                {
                    DrawFormantResetButtons();

                    if (drawTips)
                    {
                        if (EditorUtil.SimpleFoldout("Tips", true))
                        {
                            DrawTips();

                            EditorGUILayout.Separator();
                        }
                    }
                }
                --EditorGUI.indentLevel;

                EditorGUILayout.Separator();
            }

            if (drawVisualizer)
            {
                if (EditorUtil.SimpleFoldout("Visualizer", true))
                {
                    ++EditorGUI.indentLevel;
                    EditorUtil.DrawFormants(profile);
                    --EditorGUI.indentLevel;

                    EditorGUILayout.Separator();
                }
            }

            if (EditorUtil.SimpleFoldout("Settings", true))
            {
                ++EditorGUI.indentLevel;
                EditorUtil.DrawProperty(serializedObject, nameof(profile.useErrorRange));
                EditorUtil.DrawProperty(serializedObject, nameof(profile.maxErrorRange));
                EditorUtil.DrawProperty(serializedObject, nameof(profile.minLog10H));
                --EditorGUI.indentLevel;
            }

            serializedObject.ApplyModifiedProperties();
        }
Beispiel #3
0
        void DrawParameter()
        {
            if (EditorUtil.Foldout("Parameters", true))
            {
                ++EditorGUI.indentLevel;

                if (EditorUtil.SimpleFoldout("Volume", true))
                {
                    ++EditorGUI.indentLevel;

                    {
                        EditorGUILayout.BeginHorizontal();
                        EditorGUILayout.PrefixLabel("Normalized Volume");
                        var rect = EditorGUILayout.GetControlRect(true);
                        rect.y      += rect.height * 0.3f;
                        rect.height *= 0.4f;
                        Handles.DrawSolidRectangleWithOutline(rect, new Color(0f, 0f, 0f, 0.2f), new Color(0f, 0f, 0f, 0.5f));
                        rect.width  -= 2;
                        rect.width  *= Mathf.Clamp(lipSync.result.volume, 0f, 1f);
                        rect.height -= 2;
                        rect.y      += 1;
                        rect.x      += 1;
                        Handles.DrawSolidRectangleWithOutline(rect, Color.green, new Color(0f, 0f, 0f, 0f));
                        EditorGUILayout.EndHorizontal();
                    }

                    EditorUtil.DrawProperty(serializedObject, nameof(lipSync.autoVolume));

                    if (lipSync.autoVolume)
                    {
                        EditorUtil.DrawProperty(serializedObject, nameof(lipSync.minVolume));
                        EditorUtil.DrawProperty(serializedObject, nameof(lipSync.autoVolumeAmp));
                        EditorUtil.DrawProperty(serializedObject, nameof(lipSync.autoVolumeFilter));
                    }
                    else
                    {
                        EditorUtil.DrawProperty(serializedObject, nameof(lipSync.minVolume));
                        EditorUtil.DrawProperty(serializedObject, nameof(lipSync.maxVolume));
                    }

                    --EditorGUI.indentLevel;
                }
                if (EditorUtil.SimpleFoldout("Smoothness", true))
                {
                    ++EditorGUI.indentLevel;
                    EditorUtil.DrawProperty(serializedObject, nameof(lipSync.openSmoothness));
                    EditorUtil.DrawProperty(serializedObject, nameof(lipSync.closeSmoothness));
                    EditorUtil.DrawProperty(serializedObject, nameof(lipSync.vowelTransitionSmoothness));
                    --EditorGUI.indentLevel;
                }
                if (EditorUtil.SimpleFoldout("Output", true))
                {
                    ++EditorGUI.indentLevel;
                    EditorUtil.DrawProperty(serializedObject, nameof(lipSync.outputSoundGain));
                    --EditorGUI.indentLevel;
                }

                --EditorGUI.indentLevel;
                EditorGUILayout.Separator();
            }
        }