Asset Bundle vs Resources vs ??
Hello,
I'm wondering if someone can offer me some advice. I have a "Item" prefab that I can drag into a scene and assign a mesh and setup the item properties on it. The player can then pick this up and it gets added to an inventory. I was saving the meshes path and loading it on the screen when the player displays the inventory menu using:
(Mesh)AssetDatabase.LoadAssetAtPath
However, I'm still getting to grips with coding and I now realise that I can't do a build using (Mesh)AssetDatabase.LoadAssetAtPath as it uses the Unity Editor...duh. I did some research and have come across some possible alternatives in the form of Asset Bundles and Resources.
I've read through this guide on Asset Bundles and I still don't entirely understand them. Do they always have have to be uploaded and downloaded? It seems too complicated for what I need it for. I can see you can emulate it while developing a game, but I feel like there should be an easier way.
I've looked at Resources too and that looks easier to use, but everyone seems to say not to use it, including the Unity documentation. I would like to follow the best practices so I feel like this might be the wrong path too. The item models will be needed in multiple scenes, but not for the whole game so I guess I would be using up memory for these constantly.
I've also just learnt about Singletons and have implemented this for my Inventory. I am thinking about dragging all of the item prefabs into a List on the Inventory Singleton and manage it through that?
Any other ideas are welcome.
Thanks.
Answer by theangrybagelbox3 · Jun 09, 2020 at 01:56 AM
I use resources for mostly everything, but if you plan to update your game frequently, and you want your game to be modular, asset bundles would probably be the way to go.