Пример #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;
            }
        }
Пример #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();
        }