1, Substitute AssetBundle URL in the server into variables
2. Download and cache with UnityWebRequestAssetBundle.GetAssetBundle
3. Make it available on Unity with AssetBundle.getContent
4. When the same scene is loaded, the same AssetBundle will be downloaded because the URL remains the same, and this will lead to an error.
I studied AssetBundle caching, but I don't know how to use AssetBundleManifest.
There are two manifest files and I don't know how to use them.
Investigating that "AssetBundleCache is assigned to the argument" when caching, but Hash value can not be obtained from Manifest file, Hash value of 000000000000 is put
var webreq = UnityWebRequestAssetBundle.GetAssetBundle (url, cache, 0); // No value is assigned to variable cache assetBundleCache = DownloadHandlerAssetBundle.GetContent (webreq); / * Reloading Scene already downloads the same file The AssetBundle '--URL--' can't be loaded because another AssetBundle with the same files is already loaded. */
Answer # 1
In short, even if the scene changes, it is only necessary to keep the variable (or each class), so it can be done with either of the following.
Make static variable
DontDestroyOnLoadso that the GameObject with this script does not disappear when moving the scene, and always use this instance when accessing AssetBundle
Answer # 2
The cache is not relevant.
Asset bundles can be downloaded from the network or read from a file, butthings with the same name cannot be read at the same time.
When you have finished using the asset bundle, call AssetBundle.Unload method to discard it, or make it possible to see across scenes as sakura_hara says, or check loaded asset bundles with AssetBundle.GetAllLoadedAssetBundles method Please lend.
- c # - download process rarely fails
- c # - i want to download an aspnet csv file
- i want to download a file from a bucket using a uri in c # with a format starting with s3: //
- c # - i want to place a control inside a control that has already been placed with style
- c # file download is not successful while outputting mouse operation event
- c # - "an item with the same key has already been added" error when pairing with mac
- c # - to include an instance of your own subclass in assetbundle
- c # can not download from chrome when in headless mode
- c # - download from web server getbytearrayasync downloadfileasync
- [powershell or c #] i want to download a zip file that can be downloaded with a browser from a certain url
- c # - image quality is degraded when copying from dll and outputting with unity
- c # - deactivate text after animation
- c # - i want to get 6fod information of oculus quest every frame and write it out as a record
- not enough middle parenthesis c #
- c # - i want to extend a class that inherits scriptableobject of unityeditor while maintaining compatibility
- c # - error moving object by dragging
- c # - i want to load scores on my device using playerprefs
- c # - i don't understand the stairs calculation using bit operation in a millionaire
- c # - how to get the closest object
- c # - unity 2d breakout: i want to double the score for consecutive hits