Esempio n. 1
0
    private void DrawMeshSubMesh()
    {
        GUILayout.BeginHorizontal(EditorStyles.textField);
        GUILayout.Label("包含2个及以上SubMesh的网格");

        DrawMeshProperties("t:mesh", MeshSetting.SubMesh,
                           (path) =>
        {
            if (MeshExtension.GetMesh(path).subMeshCount > 1)
            {
                _meshSettingPaths.Add(path);
            }
        }, (path) =>
        {
            _window.ShowNotification(new GUIContent("暂不提供处理逻辑"));
        }
                           );

        GUILayout.EndHorizontal();

        DrawMeshScrollList(MeshSetting.SubMesh, (path) =>
        {
            _window.ShowNotification(new GUIContent("暂不提供处理逻辑"));
        });
    }
Esempio n. 2
0
    private void DrawMeshTopology()
    {
        GUILayout.BeginHorizontal(EditorStyles.textField);
        GUILayout.Label("包含非三角形的拓扑网格");

        DrawMeshProperties("t:mesh", MeshSetting.Topology,
                           (path) =>
        {
            var mi = MeshExtension.GetModelImporter(path);

            if (mi != null)
            {
                mi.keepQuads = true;
                AssetDatabase.ImportAsset(path);
            }
            //else
            //{
            //    Debug.LogError("path: " + path);
            //}

            if (MeshExtension.GetMesh(path).GetTopology(0) != MeshTopology.Triangles)
            {
                _meshSettingPaths.Add(path);
            }
            else
            {
                if (mi != null)
                {
                    mi.keepQuads = false;
                    AssetDatabase.ImportAsset(path);
                }
            }
        }, (path) =>
        {
            _window.ShowNotification(new GUIContent("暂不提供处理逻辑"));
            MeshExtension.GetModelImporter(path).keepQuads = false;
            AssetDatabase.ImportAsset(path);
        }
                           );

        GUILayout.EndHorizontal();

        DrawMeshScrollList(MeshSetting.Topology, (path) =>
        {
            _window.ShowNotification(new GUIContent("网格拓扑类型:" + MeshExtension.GetMesh(path).GetTopology(0).ToString()));
            MeshExtension.GetModelImporter(path).keepQuads = false;
            AssetDatabase.ImportAsset(path);
        });
    }