Prefab list as Database
Hello,
I'm actually working on my rpg style game. After making a couple of items, I'm looking for the "best" way to do an item database for my game. I will have maybe more than hundreds of items (potion, weapon, helmet, glove etc...). I'm a beginner about data base so I'm still a little bit confuse about it.
Is it correct to make a list with the reference of all items prefabs in it? Does it cost a lot to the engine to have this list present on my scene at runtine? I need advice about it or different better way to do it.
Thanks in advance. PS: I attach an example of my script
Answer by xxmariofer · Jan 31, 2019 at 09:11 AM
the only issues you will have is working with only one big list with all 100, but having 1 big list will not affect performance at all if thats your question. maybe dividing them by usuability makes it easier to work with thats just up to you. you can also store them in a dictionary that will prpbably make it easier to access them since you can use keys, but that are slower.
Yes, I plan to divide them into different list: Helmet, gloves, sword, axe, potion etc... So yes, it will help having small list.
I'm gonna take a look at dictionary or different list to see which one is the best for my case.
Your answer
Follow this Question
Related Questions
Best Way to Dynamically Create Objects with DB info? 0 Answers
Are there any pitfalls for putting space in GameObject/Prefab names? 1 Answer
Setting variable in prefab from a method called by prefab 1 Answer
Why couldn't I use the “Resources.Load” result directly? 1 Answer
Game Objects/Prefabs are NOT rigid/accepting collisions 0 Answers