This is a research so that I can come back and refer to in the future. I remembered concerning about this many times. Can I unload Sprite ? Or must I unload texture ? Both are assets, so is there any difference?.Can I delay the loading by not activating the component containing references to the images?.If all the references of images is in AnimationClip which is in Animator does it still load immeadiately or is it load on playing?.What if the prefab is inside Resources folder (instantiated by string path) but the reference images they refer are all outside Resources folder? What about inside-inside? Outside-inside?.What happen if I Resources.UnloadAsset() the one that is currently used? If it does not work, how to make it work?.What is considered “unused” for Resources.UnloadUnusedAssets() to unload?.(Also the exclusive AudioClip.UnloadAudioData) The latter cannot be use on GameObject or components, it must be on “asset” like Sprite . There are Resources.UnloadUnusedAssets() and Resources.UnloadAsset() to use.The only way to not connect things and load things later by string path is to put your assets in Resources folder.Even if you connect ScriptableObject asset, it would still traverse to that asset and load everything.One exception is AudioClip with preloadAudioData unchecked in the inspector (added in Unity 5.0) When the scene has been loaded it scans every game objects, and then everything connected to the component would be loaded immediately.On mobile it is especially important! First these are fundamentals : There are several interesting and ambiguous questions in Unity about when the memory will be occupied. Normally I write in Thai.ĮDIT : With the upcoming Addressable Asset System all of these will not matter! You will have complete control on loading and unloading! The Problems This time it’s in English since I thought someone might Google and stumbled upon this.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |