找回密码
 注册帐号

扫一扫,访问微社区

assetdatabase.getassetpath 获取资源路径

2014-12-31 21:51| 发布者: 杨炎| 查看: 2437| 评论: 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));

}

相关阅读

文章点评
相关文章