找回密码
 注册帐号

扫一扫,访问微社区

assetbundle.mainasset 主资源

2014-12-31 16:41| 发布者: 杨炎| 查看: 2479| 评论: 0|原作者: 蛮牛|来自: unity3d脚本manual

摘要: assetbundle.mainasset 主资源varmainasset:objectdescription描述main asset that was supplied when building the asset bundle (read only).主资源在构建资源boundle时指定(只读)。this is a convenience funct ...

assetbundle" target="_blank" class="relatedlink">assetbundle.mainasset 主资源

varmainasset:object

description描述

main asset that was supplied when building the asset bundle (read only).

主资源在构建资源boundle时指定(只读)。

this is a convenience function that makes it easy to find the primary asset of a bundle. for example you might want to have a prefab of a character and include all textures, materials, meshes and animations files with it. but the fully rigged prefab of the character would be your mainasset and can easily be accessed.

该功能可以方便的找到bundle内的主资源。例如,你也许想有一个角色的预制体并包括所有纹理、材质、网格和动画文件。但是完全操纵角色的预设体应该是你的mainasset并且易于被访问。

function start () {

var www = newwww("http://myserver/mybundle.unity3d");

yield www;

//获取指定的主资源并实例化

instantiate(www.assetbundle.mainasset);

}

文章点评