Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
AssetPostprocessor 资源处理器
# AssetPostprocessor 资源处理器 AssetPostprocessor lets you hook into the import pipeline and run scripts prior or after importing assets. AssetPostprocessor 让你挂接导入管线,在运行脚本之前或导入资源之后。 Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script. 注意:这是一个编辑器类,如果想使用它你需要把它放到工程目录下的 Assets/Editor 文件夹下。编辑器类在 UnityEditor 命名空间下。所以当使用 C#脚本时,你需要在脚本前面加上 "using UnityEditor"引用。 This way you can override default values in the import settings or modify the imported data like textures or meshes. 这样你可以在导入的设置中重载默认值或修改导入的数据,如纹理或网格。 ### Variables**变量** * [assetPath](AssetPostprocessor.assetPath.html) The path name of the asset being imported. 被导入的资源的路径名 * [assetImporter](AssetPostprocessor.assetImporter.html) Reference to the asset importer 引用资源导入器 ### Functions**函数** * [LogWarning](AssetPostprocessor.LogWarning.html) Logs an import warning to the console. 记录一个导入警告到控制台 * [LogError](AssetPostprocessor.LogError.html) Logs an import error message to the console. 记录一个导入错误消息到控制台 * [GetPostprocessOrder](AssetPostprocessor.GetPostprocessOrder.html) Override the order in which importers are processed. 重载导入器执行的次序 ### Messages Sent**发送消息** * [OnPreprocessTexture](AssetPostprocessor.OnPreprocessTexture.html) Add this function in a subclass to get a notification just before the texture importer is run. 在子类中重载这个函数以便在纹理导入器运行之前获取通知 * [OnPostprocessTexture](AssetPostprocessor.OnPostprocessTexture.html) Add this function in a subclass to get a notification when a texture has completed importing just before the texture is saved to disk. 在子类中加入这个函数,以便在纹理载入存入磁盘之前获得一个通知。 * [OnPreprocessModel](AssetPostprocessor.OnPreprocessModel.html) Add this function in a subclass to get a notification just before a model (.fbx, .mb file etc.) is being imported. 在子类中加入这个函数,以便在模型载入之前获得一个通知。 * [OnPostprocessModel](AssetPostprocessor.OnPostprocessModel.html) Add this function in a subclass to get a notification when a model has completed importing 在子类中加入这个函数,以便在模型载入之后获得一个通知。 * [OnPostprocessGameObjectW...](AssetPostprocessor.OnPostprocessGameObjectWithUserProperties.html "OnPostprocessGameObjectWithUserProperties") Gets called for each GameObject that had at least one userpropery attached to it in the imported file. 在导入文件中,为每个至少附加了一个用户属性的游戏物体调用。 * [OnAssignMaterialModel](AssetPostprocessor.OnAssignMaterialModel.html) Feeds a source material 获取一个源材质 * [OnPostprocessAudio](AssetPostprocessor.OnPostprocessAudio.html) Add this function in a subclass to get a notification when an audio clip has completed importing. 在子类中加入这个函数,以便在一个声音剪辑载入后获得一个通知。 * [OnPreprocessAudio](AssetPostprocessor.OnPreprocessAudio.html) Add this function in a subclass to get a notification just before an audio clip is being imported. 在子类中加入这个函数,以便在一个声音剪辑载入之前获得一个通知。 * [OnPostprocessAllAssets](AssetPostprocessorOnPostprocessAllAssets.OnPostprocessAllAssets.html) This is called after importing of any number of assets is complete (when the Assets progress bar has reached the end). 在一些资源被导入后调用(当资源进度条到达末端)
da
2022年5月14日 13:07
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码