- Home /
Store card data
Hi, I'm developing a card game. Each card has some values associated (title, descriptions, habilities, power, cost, etc) and I'm not sure what would be the best option to store this.
I thought 3 solutions:
Creating a prefab for each card and storing the texts on public variables, editing them in the inspector. I don't like this option because if I want to make any change on the style of the cards I will have to modify all prefabs.
Creating a general template for the cards and loading its data from a JSON/XML file. I don't like this options because the file is readable & editable by the player.
Creating a general template and storing all card data in a static class. But I'm not sure if this is a good practice.
What would be a good option to do this? Thanks.
Answer by dacarrera · Dec 16, 2017 at 09:33 PM
ScriptableObjects could be a really good option here. If you're into the "creating a general template" this would be a convenient choice without having to parse/load data from a JSON/XML file. This is a good place to start: https://docs.unity3d.com/ScriptReference/ScriptableObject.html
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer
Stack Card 0 Answers
Store data for tile based system 1 Answer