Enemy Database using list/dictionary to store stats (C#)?
How can I use a list or dictionary to store all of the enemy's stats? I have been searching through unity's documentation for a very long time, and found nothing. I am trying to create a real-time battle system, where up to 5 enemies can be in battle at once, each of them is also previously seen outside of battle, meaning there will have to be some kind of enemy queue (not actually sure if this part involves a dictionary or not). More importantly, I want to be able to store all of the battle information and stats in a dictionary or list, and when the player comes in contact with the enemy gameobject, it initiates a battle using a specified index in the dictionary to keep track of, and separate stats. There will probably be a variety of enemies in battles with more than one. I am not asking anyone to program the entire system, but if you know anything about this topic, it would be appreciated. Thanks in advance.
Answer by Dinosaurs · Aug 05, 2016 at 04:20 AM
If you're trying to create a data object to store lists of creatures and stats, I'd recommend doing so using a Scriptable Object. Here's the official Unity docs: https://docs.unity3d.com/ScriptReference/ScriptableObject.html
And here's a tutorial I found useful that you could use as a base to create a similar data structure for your own game: http://www.jacobpennock.com/Blog/unity-pro-tip-use-custom-made-assets-as-configuration-files/
Your answer
Follow this Question
Related Questions
How to create a turn based system manager? 0 Answers
InvalidOperationException: Operation is not valid due to the current state of the object 1 Answer
Insert string into empty list at a specific index 0 Answers
Need help to generate a random assortment of 4 buttons - C# 0 Answers
Most efficient way to store information in an inspector dropdown menu? 0 Answers