Version: 2017.1

AssetPostprocessor.OnPreprocessModel()

切换到手册

描述

Add this function in a subclass to get a notification just before a model (.fbx, .mb file etc.) is imported.

借助此函数,您可以通过代码控制导入设置。

    // Disable import of materials if the file contains
// the @ sign marking it as an animation.

class DisableMaterialImport extends AssetPostprocessor { function OnPreprocessModel () { if (assetPath.Contains("@")) { var modelImporter : ModelImporter = assetImporter; modelImporter.importMaterials = false; } } }