- Home /
Help on making a Database.
I'm currently developing a survival game, in which I need databases for various mechanics (Items,Status Effects, Player-Stats, Player-Scores). My main focus at the moment is the item database as I wish to have a randomly generated loot system that is automatically maintained via creation of items using my editor script that serializes items (When creating an item with this script there is a enum for which loot tables the item is featured in, my hope is that I can set this and then the database will be automatically updated).
What I have tried:
Using an XML file that stores basic info of items and also the path to the item in the resources folder. I decided this was a bad idea when through my research I learnt that using Resources.Load() is an extremely inefficient way to manage and load assets.
I tried using the XML serialization feature to serialize the info of my item scripts as seen here. My reason for not using this is because I don't understand how to use this in relation to actual in game assets without using Resources.Load().
I'm currently considering just using a script in game that holds an array of game objects the problem with this is that every time I add an Item I will have to manually add it to this list (Unless there is some sort of editor script I can run).
So what I need help with is:
What is the most effective way to manage a large collection of prefabs whilst being able to sort, quickly access and instantiate them from the list?
Is having a list or array of game objects held on a script less computationally expensive then using the resources.load feature?
Any help would be much appreciated thanks.
Your answer
Follow this Question
Related Questions
Xml Saving and Loading Problems 1 Answer
Collectables across multiple levels 3 Answers
Pass a GameObject to a DLL 2 Answers
How to type Color32 format into XML? 1 Answer
How can I save a xml file but the data will be coming from a Input Field? 1 Answer