AssetPostprocessor.OnPreprocessModel 在导入模型之前

function OnPreprocessModel () : void

Description描述

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

在子类中加入这个函数,以便在模型载入之前获得一个通知。

This lets you control the import settings trough code.

它让你控制导入选项

class MyMeshPostprocessor extends AssetPostprocessor {
   function OnPreprocessModel () {
		// Disable generation of materials if the file contains
		// the @ sign marking it as an animation.
		// 如果文件包含@符号,禁用generateMaterials
		if (assetPath.Contains("@")) {
			var modelImporter : ModelImporter = assetImporter;
			modelImporter.generateMaterials = 0;
		}
	}
}
Page last updated: 2011-1-8