I'm having a little problem trying to unload some assets, has someone here successfully used it? The documentation don't say much about how to use it, and looks that it is a really unfamous method, google only showed two results. Code (csharp): Object _puzzle; _puzzle = Resources.Load("resource"); Instantiate(_puzzle); Resources.UnloadAsset(_puzzle); And the error I always get is: UnloadAsset may only be used on individual assets and can not be used on GameObject's / Components or AssetBundles UnityEngine.Resources:UnloadAsset(Object)
Hmm, since you didn't specify exactly what it is you loaded, Unity assumes you loaded a Prefab (hence the GameObject reference in the error), and you don't need to unload prefabs (I don't think. Someone correct me if I'm wrong here).
Hello guys, I'm having the same problem here ... if somebody knows why this happens, please explain. Thanks
Same here, please, someone, how to use it to unload prefab loaded from resources? I instantiated it directly from Resource.Load() casting it to GameObject. Should i store it as Object first, to be able to unload it later?
It appears to only work on asset container classes- for example if I load a prefab that contains an atlas for my particular UI package and I try to unload it I will get that error but if I try to unload the Texture member of the class it works fine.