您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
28 行
708 B
28 行
708 B
using UnityEngine;
|
|
using UnityEditor;
|
|
|
|
// Automatically convert any texture file with "_bumpmap"
|
|
// in its file name into a normal map.
|
|
|
|
class MyMeshPostprocessor : AssetPostprocessor
|
|
{
|
|
|
|
|
|
|
|
void OnPreprocessModel()
|
|
{
|
|
|
|
ModelImporter modelImporter = (ModelImporter)assetImporter;
|
|
|
|
|
|
// Game Assets --------------------------------------------------------------------
|
|
if (assetPath.Contains(".fbx") || assetPath.Contains(".FBX"))
|
|
{
|
|
modelImporter.importMaterials = true;
|
|
modelImporter.materialName = ModelImporterMaterialName.BasedOnMaterialName;
|
|
modelImporter.materialSearch = ModelImporterMaterialSearch.Everywhere;
|
|
|
|
}
|
|
|
|
}
|
|
}
|