找回密碼
 注冊帳號

掃一掃,訪問微社區

assetpostprocessor.onpostprocessallassets 在導入所有資源之后

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

摘要: assetpostprocessor.onpostprocessallassets 在導入所有資源之后functiononpostprocessallassets(importedassets: string,deletedassets: string,movedassets: string,movedfrompath: string) : voiddescription描述 ...

assetpostprocessor.onpostprocessallassets 在導入所有資源之后

functiononpostprocessallassets(importedassets: string[],deletedassets: string[],movedassets: string[],movedfrompath: string[]) : void

description描述

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

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

this call can occur after a manual reimport, or any time you move an asset or folder of assets to a new location in the project view. all string arrays are filepaths relative to the project's root assets folder. importedassets contains paths of all assets used in the operation. each consecutive index of movedassets and movedfromassetpaths will always refer to the same asset.

這個調用發生在手動導入之后,或者在工程面板移動一個資源或資源文件夾到新位置時調用.所有的字符串數組是相對于工程根資源文件夾的文件路徑.importedassets包含該操作中使用的所有資源的路徑.每個不同的moveassets和movefromassetpaths索引允許引用相同的資源.

if you perform a bulk operation on several individual assets instead of a folder containing those assets, this function will be called once per asset with each individual asset as the only item in the various arrays.

如果你對幾個獨立資源執行一個批量操作,而這些資源不在一個文件夾內時,每個資源作為各自隊列中唯一的單位調用這個函數.

class myallpostprocessor extends assetpostprocessor {

static function onpostprocessallassets (

importedassets :string[],

deletedassets :string[],

movedassets :string[],

movedfromassetpaths :string[])

{

for (var str in importedassets) {

debug.log("reimported asset: " + str);

}

for (var str in deletedassets) {

debug.log("deleted asset: " + str);

}

for (var i=0;i < movedassets.length;i++) {

debug.log("moved asset: " + movedassets[i] + " from: " + movedfromassetpaths[i]);

}

}

}

相關閱讀

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