找回密碼
 注冊帳號

掃一掃,訪問微社區

assetbundle.mainasset 主資源

2014-12-31 16:31| 發布者: 楊炎| 查看: 1968| 評論: 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);

}

文章點評
女校游泳队彩金