How should I store trading cards?

I'm working on a Magic-esque TCG in Unity. Currently, the cards themselves are all prefabs: I have a Satyr Archer prefab, a Candle Wisp prefab, etc. This works fine for now, since I only have a few cards, but by the time I get to several hundred, I feel that this may become unwieldy.

Are prefabs a good way to store a large list of cards? Should I be making those prefabs using an XML document and a script?


If you want to contain your whole workflow within Unity then you might be looking for ScriptableObjects. Create a class which extends ScriptableObject and stores all the properties of a card. The nice thing about ScriptableObjects is that you can manage them as assets in your games resource folder. You can even write an editor extension for them to better edit your card properties within Unity.

Outsourcing your game data to XML is also an option, but it means that you will need a second program to edit it. That can be a simple text editor or a more fancy XML editor, but when you rely on general-purpose tools to edit XML it would likely be less comfortable than what Unity offers out-of-the-box when you use ScriptableObjects. You could also write your own application outside of Unity to edit your XML card database. When you don't have to work within the confines of what Unity editor scripting allows you to do (although that is quite a lot) you might be able to create a far more powerful application which is far better tailored for your needs. But you will have to invest quite a lot of work for that. You need to make your own cost-benefit analysis if such an editor would be worth it or not

Category: unity Time: 2016-07-28 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.240 (s). 12 q(s)