找回密碼
 注冊帳號

掃一掃,訪問微社區

assetdatabase.getassetpath 獲取資源路徑

2014-12-31 21:51| 發布者: 楊炎| 查看: 2402| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: assetdatabase.getassetpath 獲取資源路徑static functiongetassetpath(assetobject:object) : stringstatic functiongetassetpath(instanceid: int) : stringdescription描述returns the path name relative to the ...

assetdatabase.getassetpath 獲取資源路徑

static functiongetassetpath(assetobject:object) : string

static functiongetassetpath(instanceid: int) : string

description描述

returns the path name relative to the project folder where the asset is stored

返回相對于工程資源位置的路徑名。

all paths are relative to the project folder. like: "assets/mytextures/hello.png"

所有的路徑都是相對于工程目錄文件。 例如” assets/mytextures/hello.png”

@menuitem("gameobject/creatematerial")

static function creatematerial () {

// create a simple material asset

//新建一個簡單的材質資源

var material = newmaterial(shader.find("specular"));

assetdatabase.createasset(material, "assets/mymaterial.mat");

// print the path of the created asset

//打印新建資源的路徑

debug.log(assetdatabase.getassetpath(material));

}

相關閱讀

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