I have this alert when I build my game in windows phone.
Incorrectly unloaded MonoBehaviour class ‘BootsItem’ in prefab ‘Boots’ during GarbageCollectUnusedAssets.
The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.
Hello, I’m facing the same problem, too.
Because there are so many identical reports(seems every class derived from MonoBehaviour), I can’t add this sentence to all of them. Besides, if I do so, will I get out of memory? Is there any other alternative solution?
it’s was not happening on unity 4.3.2, but now in Unity 4.3.3 is going on always, and this is bothersome, because doing very slow the transition between scenes and feels unusual, there is no way the prevent it log shows this message. Without specify to all objects that will destroy with method Destroy?
I remember facing the same issue…so what I did was to remove static prefabs assigned from Inspector and instead created
them dynamically in script and then this error stopped.
“Incorrectly unloaded MonoBehaviour class ‘UISprite’ in prefab ‘Chapter’ during GarbageCollectUnusedAssets.
The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.”
i keep getting above error after switching to new scene where i am not using Chapter Prefab and its related texture atlas at all. I I dont want any kind of reference to that atlas in game scene because its a huge atlas and consuming. How to tackle this issue. I tried destroying the object, setting the variable to null still i am getting this error.
Could you explain what the problem was and how it was fixed?
I’m stuck on 4.3.4 just now and getting this a lot. It looks to me like it’s caused by objects not being garbage collected that should be - as other people have mentioned the things that the warnings are for are objects that we’re not explicitly holding onto ourselves so should be cleared away when we change scene.
I believe that in our case it’s actually affecting the game negatively (rather than being just an annoyance) - we’re seeing UI atlases not being cleared away and then when returning to the original scene they are often missing their texture (which presumably has been cleared) causing UI to not render. I’m currently debugging the garbage collector code trying to track down why these objects are persisting but it’s slow work.