Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
AssetBundle 资源包
# AssetBundle 资源包 Inherits from [Object](../Object/Object.html) AssetBundles let you stream additional assets via the WWW class and instantiate them at runtime. AssetBundles are created via [BuildPipeline.BuildAssetBundle](../BuildPipeline/BuildPipeline.BuildAssetBundle.html). AssetBundles 让你通过 WWW 类流式加载额外的资源并在运行时实例化它们。AssetBundles 通过 [BuildPipeline.BuildAssetBundle](../BuildPipeline/BuildPipeline.BuildAssetBundle.html) 创建。 参见: [WWW.assetBundle](../WWW/WWW.assetBundle.html), [BuildPipeline.BuildPlayer](../BuildPipeline/BuildPipeline.BuildPlayer.html). ``` function Start () { //开始下载 var www = WWW ("http://myserver/myBundle.unity3d"); //等待下载完成 yield www; //获取指定的主资源并实例化 Instantiate(www.assetBundle.mainAsset); } ``` ### Variables**变量** * [mainAsset](AssetBundle.mainAsset.html) Main asset that was supplied when building the asset bundle (Read Only). 主资源在构建资源 boundle 时指定(只读)。 ### Functions**函数** * [Contains](AssetBundle.Contains.html) Check if an AssetBundle contains a specific object. 如果 AssetBundle 的名称中包含特定的对象则进行检索。 * [Load](AssetBundle.Load.html) Loads object with name from the bundle. 从 bundle 中加载名为 name 的对象。 * [LoadAsync](AssetBundle.LoadAsync.html) Asynchronously loads object with name of a given type from the bundle. 异步地从 bundle 中加载被指定类型的名为 name 的对象。 * [LoadAll](AssetBundle.LoadAll.html) Loads all objects contained in the asset bundle that inherit from type. 加载所有包含在资源 bundle 中且继承自 type 的对象。 * [Unload](AssetBundle.Unload.html) Unloads all assets in the bundle. 卸载包含在资源 bundle 中的所有对象。 ## Inherited members**继承成员** ### Inherited Variables**继承变量** * [name](../Object/Object.name.html) The name of the object. //物体的名字 * [hideFlags](../Object/Object.hideFlags.html) Should the object be hidden, saved with the scene or modifiable by the user? 物体是否被隐藏、保存在场景中或被用户修改? ### Inherited Functions**继承函数** * [GetInstanceID](../Object/Object.GetInstanceID.html) Returns the instance id of the object. 返回物体的实例 ID * [ToString](../Object/Object.ToString.html) Returns the name of the game object. 返回游戏物体的名称。 ### Inherited Class Functions**继承类函数** * [operator bool](../Object/Object.operator_bool.html) Does the object exist? 物体是否存在? * [Instantiate](../Object/Object.Instantiate.html) Clones the object original and returns the clone. 克隆原始物体,并返回克隆的物体 * [Instantiate.<T>](../Object/Object.Instantiate.ltTgt.html) * [Destroy](../Object/Object.Destroy.html) Removes a gameobject, component or asset. 删除一个游戏物体、组件或资源 * [DestroyImmediate](../Object/Object.DestroyImmediate.html) Destroys the object obj immediately. It is strongly recommended to use Destroy instead. 立即销毁物体 obj,强烈建议使用 Destroy 代替。 * [FindObjectsOfType](../Object/Object.FindObjectsOfType.html) Returns a list of all active loaded objects of Type type. 返回 Type 类型的所有激活的加载的物体列表 * [FindObjectOfType](../Object/Object.FindObjectOfType.html) Returns the first active loaded object of Type type. 返回 Type 类型第一个激活的加载的物体。 * [operator ==](../Object/Object.operator_eq.html) Compares if two objects refer to the same 比较如果两个物体相同 * [operator !=](../Object/Object.operator_ne.html) Compares if two objects refer to a different object 比较如果两个物体不同 * [DontDestroyOnLoad](../Object/Object.DontDestroyOnLoad.html) Makes the object target not be destroyed automatically when loading a new scene. 加载新场景的时候使目标物体不被自动销毁。
da
2022年5月14日 12:54
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码