找回密碼
 注冊帳號

掃一掃,訪問微社區

assetpostprocessor 資源處理器

2015-1-1 07:16| 發布者: 楊炎| 查看: 2410| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: assetpostprocessor 資源處理器assetpostprocessor lets you hook into the import pipeline and run scripts prior or after importing assets.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

the path name of the asset being imported.

被導入的資源的路徑名

assetimporter

reference to the asset importer

引用資源導入器

functions函數

logwarning

logs an import warning to the console.

記錄一個導入警告到控制臺

logerror

logs an import error message to the console.

記錄一個導入錯誤消息到控制臺

getpostprocessorder

override the order in which importers are processed.

重載導入器執行的次序

messages sent發送消息

onpreprocesstexture

add this function in a subclass to get a notification just before the texture importer is run.

在子類中重載這個函數以便在紋理導入器運行之前獲取通知

onpostprocesstexture

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

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

在子類中加入這個函數,以便在模型載入之前獲得一個通知。

onpostprocessmodel

add this function in a subclass to get a notification when a model has completed importing

在子類中加入這個函數,以便在模型載入之后獲得一個通知。

onpostprocessgameobjectw...

gets called for each gameobject that had at least one userpropery attached to it in the imported file.

在導入文件中,為每個至少附加了一個用戶屬性的游戲物體調用。

onassignmaterialmodel

feeds a source material

獲取一個源材質

onpostprocessaudio

add this function in a subclass to get a notification when an audio clip has completed importing.

在子類中加入這個函數,以便在一個聲音剪輯載入后獲得一個通知。

onpreprocessaudio

add this function in a subclass to get a notification just before an audio clip is being imported.

在子類中加入這個函數,以便在一個聲音剪輯載入之前獲得一個通知。

onpostprocessallassets

this is called after importing of any number of assets is complete (when the assets progress bar has reached the end).

在一些資源被導入后調用(當資源進度條到達末端)

相關閱讀

文章點評
相關文章
女校游泳队彩金