Exemplo n.º 1
0
        void DrawMiscPanel()
        {
            var settings = m_target.settings;

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.BeginVertical(GUILayout.Width(indentSize));
            EditorGUILayout.Space();
            EditorGUILayout.EndVertical();

            EditorGUILayout.BeginVertical(GUILayout.Width(c1Width));
            EditorGUILayout.LabelField("", GUILayout.Width(c1Width));
            EditorGUILayout.Space();
            EditorGUILayout.EndVertical();

            EditorGUILayout.BeginVertical(GUILayout.Width(spaceSize));
            EditorGUILayout.Space();
            EditorGUILayout.EndVertical();

            EditorGUILayout.BeginVertical();
            {
                var mirrorMode = settings.mirrorMode;
                settings.mirrorMode = (MirrorMode)EditorGUILayout.EnumPopup("Mirroring", settings.mirrorMode);
                if (mirrorMode != settings.mirrorMode)
                {
                    m_target.ApplyMirroring(true);
                }

                EditorGUILayout.Space();
                settings.tangentsMode = (TangentsUpdateMode)EditorGUILayout.EnumPopup("Tangents Update Mode", settings.tangentsMode);
                if (settings.tangentsMode == TangentsUpdateMode.Manual)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("", GUILayout.Width(indentSize));
                    if (GUILayout.Button("Recalculate Tangents [T]"))
                    {
                        m_target.RecalculateTangents();
                    }
                    EditorGUILayout.EndHorizontal();
                }
                settings.tangentsPrecision = (TangentsPrecision)EditorGUILayout.EnumPopup("Tangents Precision", settings.tangentsPrecision);

                if (m_target.GetComponent <SkinnedMeshRenderer>() != null)
                {
                    EditorGUILayout.Space();
                    if (GUILayout.Button("Reset To Bindpose"))
                    {
                        m_target.ResetToBindpose(true);
                    }
                }
            }

            EditorGUILayout.Space();
            if (GUILayout.Button("Save Settings"))
            {
                m_target.ExportSettings("Assets/UTJ/NormalPainter/Data/DefaultSettings.asset");
            }

            EditorGUILayout.EndVertical();
            EditorGUILayout.EndHorizontal();
        }