- Home /
Using a pragma to disable AssetBundle errors
Is it possible to use a pragma to disable errors?
[In my particular example, I have similar AssetBundles in different locations (copied around - must be this way), and when loading them all in, I get an "AssetBundle already loaded" error, because Unity detects that what I try to load is already there although coming from a different file. would like to disable the error about the AssetBundle being already loaded. It does not do any harm, but it is annoying.
I tried
#pragma warning disable
and
#pragma warning restore
but the AssetBundle thing is an error, not a warning, and thus this does not work.
Has anybody any idea?
Answer by intensenex · Nov 24, 2011 at 09:32 PM
Try to unload all assets by
AssetBundle.Unload
then reload if needed
The point is that I do not want to Unload the assets - I need them all - but to disable the warning if I load one multiple times (co$$anonymous$$g from different files, possibly different filenames).
Your answer
![](https://koobas.hobune.stream/wayback/20220613034518im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to import the object from server to unity 2 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
AssetBundles coding 1 Answer
Using an FTP site to store AssetBundles 2 Answers
How to change position of gameobjects in an asset bundle externally using a javascript 1 Answer