assetdatabase.loadassetatpath 指定路径加载资源

2015-1-1 00:41| 发布者: 杨炎| 查看: 2520| 评论: 0|原作者: 蛮牛|来自: yzc88亚洲城脚本manual

摘要: assetdatabase.loadassetatpath 指定路径加载资源static functionloadassetatpath(assetpath: string,type: type) :objectdescription描述returns the first asset object of type type at given path assetpath.返 ...

assetdatabase.loadassetatpath 指定路径加载资源

static functionloadassetatpath(assetpath: string,type: type) :object

description描述

returns the first asset object of type type at given path assetpath.

返回在指定位置assetpath下第一个类型是type的资源对象

some asset files may contain multiple objects. (such as a maya file which may contain multiple meshes and gameobjects). all paths are relative to the project folder. like: "assets/mytextures/hello.png".

有些资源文件可能包含许多对象。(例如一个maya文件可能包含许多个网格和游戏物体)。所有的路径都是相对于工程目录文件. 例如” assets/mytextures/hello.png”

note: the assetpath parameter is not needed to be case sensitive. all asset names & paths in unity are with forward slashes.

注意:参数assetpaht不需要区分大小写。在unity中所有的资源名称和路径都需要斜杠/。

参见:assetdatabase.loadmainassetatpath,assetdatabase.loadallassetsatpath

相关阅读

文章点评
相关文章