- Home /
Database-like arrays
What is the best method to organize a medium/large amount of enemies, items and possibly abilities (50~200).
I saw some tutorials using enum but it can hold few a single string, I might be able to use prefabs for enemies.
I am using classes for the structure, but how can I populate/create the actual object in one main location for easier organization.
I am thinking of an RPG game, so any relevant information would be great too.
Answer by whydoidoit · Mar 25, 2013 at 09:56 AM
Sounds like you should either store the data in a text file and parse it out when the game runs or use Unity's scenes to store the data and fill them out in the inspector.
Just make sure that the enemy definition is serializable and then declare an array of them.
[Serializable]
public class MyEnemyData
{
...
}
public MyEnemyData[] enemies;
Great! thanks, I can use xml format and encrypt it, divide data to smaller files for better performance when loading.