public ConstructCard(ConstructCardDesc desc) : base(desc) { this.hp = desc.hp; this.movesPerTurn = desc.movesPerTurn; this.targetAOEtype = desc.targetAOEtype; this.numOfTargets = desc.numOfTargets; this.turnsToBuild = desc.turnsToBuild; }
public static void saveInstance() { ConstructCardDesc desc = new ConstructCardDesc { id = 0, name = "sample", description = "this is a sample card", type = CardType.CONSTRUCT, rarity = Rarity.COMMON, collectible = true, set = CardSet.BASIC, hp = 10, movesPerTurn = 1, targetAOEtype = AOEtype.LINEAR, numOfTargets = 1, turnsToBuild = 2 }; string json = UnityEngine.JsonUtility.ToJson(desc, prettyPrint: true); File.WriteAllText(@"example_card.json", json); }