Example #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;
            }
        }
Example #2
0
 void DrawCallback()
 {
     if (EditorUtil.Foldout("Callback", true))
     {
         ++EditorGUI.indentLevel;
         EditorUtil.DrawProperty(serializedObject, nameof(lipSync.onLipSyncUpdate));
         --EditorGUI.indentLevel;
         EditorGUILayout.Separator();
     }
 }
Example #3
0
        void DrawConfig()
        {
            if (EditorUtil.Foldout("Calculation Config", false))
            {
                ++EditorGUI.indentLevel;

                EditorUtil.DrawProperty(serializedObject, nameof(lipSync.config));
                DrawSetConfigButtons();

                if (lipSync.config)
                {
                    CreateCachedEditor(lipSync.config, typeof(ConfigEditor), ref configEditor_);
                    if (configEditor_)
                    {
                        configEditor_.OnInspectorGUI();
                    }
                }

                --EditorGUI.indentLevel;

                EditorGUILayout.Separator();
            }
        }
Example #4
0
        void DrawProfile()
        {
            if (EditorUtil.Foldout("LipSync Profile", true))
            {
                ++EditorGUI.indentLevel;

                EditorUtil.DrawProperty(serializedObject, nameof(lipSync.profile));
                DrawSetProfileButtons();

                if (lipSync.profile)
                {
                    CreateCachedEditor(lipSync.profile, typeof(ProfileEditor), ref profileEditor_);
                    var editor = profileEditor_ as ProfileEditor;
                    if (editor)
                    {
                        editor.Draw(true, false);
                    }
                }

                --EditorGUI.indentLevel;

                EditorGUILayout.Separator();
            }
        }
Example #5
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();
            }
        }