![]() ![]() Next, an asset, such as a GameObject containing meshes and textures, is retrieved from the AssetBundle. From reading the docs, it appears that first an AssetBundle is retrieved from storage and eventually ends up in system RAM. Why does this happen? This is in Unity 2017.1.ĭevelopers need more information about where the data are going when asset loading operations are being performed. When I use AssetBundle.LoadAssetAsync, it still freezes up the rendering thread while loading the asset. The "Loading AssetBundles" link is broken. GameObject prefab = assetLoadRequest.asset as GameObject Var assetLoadRequest = myLoadedAssetBundle.LoadAssetAsync("MyObject") Var myLoadedAssetBundle = bundleLoadRequest.assetBundle ĭebug.Log("Failed to load AssetBundle!") Var bundleLoadRequest = AssetBundle.LoadFromFileAsync(Path.Combine(Application.streamingAssetsPath, "myassetBundle")) Public class LoadFromFileAsyncExample : MonoBehaviour Please note that loading the bundle and the assets in it may not lock the main thread but instancing multiple game objects from the bundle could generate hitches in performance. Here is a code example that should not block the main thread. To load the objects of the AssetBundles in an asynchronous way, in order to avoid blocking the main thread of the computer, you need to call the AssetBundle.LoadAssetAsync method. The main thread is blocked while loading the assets.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |