AssetBundle 资源包
Inherits from Object
AssetBundles let you stream additional assets via the WWW class and instantiate them at runtime. AssetBundles are created via BuildPipeline.BuildAssetBundle.
AssetBundles让你通过WWW类流式加载额外的资源并在运行时实例化它们。AssetBundles通过BuildPipeline.BuildAssetBundle创建。
参见: WWW.assetBundle, BuildPipeline.BuildPlayer.
function Start () {
//开始下载
var www = WWW ("http://myserver/myBundle.unity3d");
//等待下载完成
yield www;
//获取指定的主资源并实例化
Instantiate(www.assetBundle.mainAsset);
}
Variables变量
Functions函数
-
Check if an AssetBundle contains a specific object.
如果AssetBundle的名称中包含特定的对象则进行检索。
-
Loads object with name from the bundle.
从bundle中加载名为name的对象。
-
Asynchronously loads object with name of a given type from the bundle.
异步地从bundle中加载被指定类型的名为name的对象。
-
Loads all objects contained in the asset bundle that inherit from type.
加载所有包含在资源bundle中且继承自type的对象。
-
Unloads all assets in the bundle.
卸载包含在资源bundle中的所有对象。
Class Functions类函数
Inherited members继承成员
Inherited Variables继承变量
-
The name of the object. //物体的名字
-
Should the object be hidden, saved with the scene or modifiable by the user?
物体是否被隐藏、保存在场景中或被用户修改?
Inherited Functions继承函数
Inherited Class Functions继承类函数
-
Removes a gameobject, component or asset.
删除一个游戏物体、组件或资源
-
Destroys the object obj immediately. It is strongly recommended to use Destroy instead.
立即销毁物体obj,强烈建议使用Destroy代替。
-
Makes the object target not be destroyed automatically when loading a new scene.
加载新场景的时候使目标物体不被自动销毁。
-
Returns the first active loaded object of Type type.
返回Type类型第一个激活的加载的物体。
-
Returns a list of all active loaded objects of Type type.
返回Type类型的所有激活的加载的物体列表
-
Clones the object original and returns the clone.
克隆原始物体,并返回克隆的物体
Page last updated: 2011-9-16