Hey there,
I have a feature I want to build, but I can't quite figure out a good way to go about it in Unity ECS. I'm hoping some of you more experienced folks might be able to give me some advice.
I'm making a multiplayer game where players can have a variety of items they can use that they get to choose. I'm currently storing which items a player has in a synchronized dynamic buffer on the player entity, and an item type ID (currently an asset guid) is stored on each item in the buffer. Whenever the player uses the item, I need to look up info about that item on both the client and server (eg. what kind of projectile prefab that item can spawn). I was thinking about storing item type info in scriptable objects, but I'm not sure how to properly load them at runtime. Do I need to load them via AssetDatabase and convert them to a Blob? But then how do I convert a projectile prefab to an Entity like you can in a baker? Should I convert them at baking time somehow? Should I use a different approach altogether?
Another way I can think of to do this is to create the items as ghost prefabs, spawn them, and associate them with the player somehow.
I feel like there has to be a simpler solution though... any ideas?