[Unity]FBX默认导入设置修改器

using UnityEditor;
public class EditorFbxImportSetting : AssetPostprocessor 
{
    void OnPreprocessModel() 
    {
        ModelImporter importer = assetImporter as ModelImporter;
        if (importer == null)
        {
            return;
        }

        string name = importer.assetPath.ToLower();
        string extension = name.Substring(name.LastIndexOf(".")).ToLower();
        switch (extension) 
        {
        case ".3ds":
        case ".fbx":
        case ".blend":
            importer.importMaterials = false;
            importer.importCameras = false;
            importer.importLights = false;
            importer.generateSecondaryUV = false;
            importer.swapUVChannels = false;
            importer.optimizeMesh = true;
            break;

        default:
            break;
        }
    }
}

这样美术在导入FBX时,就不用一个个勾掉Material设置了

--转载请注明: http://blog.coolcoding.cn/?p=1563

你可能感兴趣的:(Unity)