public static bool MatchCard(CardPrototype p1, CardPrototype p2) { if (p1.number >= 10) { return(p1.number == p2.number); } return(p1.number + p2.number == 10); }
public CardModel(CardPrototype prototype) { this.prototype = prototype; this.name = prototype.cardName; this.health = prototype.health; this.damage = prototype.damage; this.sprite = prototype.sprite; this.timeToCast = prototype.timeToCast; this.cardsToDraw = prototype.cardsToDraw; this.casterHpToHeal = prototype.casterHpToHeal; }
public CardModel(CardPrototype prototype) { this.prototype = prototype; id = prototype.id; name = prototype.name; description = prototype.description.Replace("\\n", "\n"); // Allow newlines animation = prototype.animation; rarity = prototype.rarity; cost = prototype.cost; effect = prototype.effect; statGainType = prototype.statGainType; statGainAmount = prototype.statGainAmount; numCardsToDraw = prototype.numCardsToDraw; }
public void Init() { if (startingCards == null) { startingCards = new List <CardPrototype>(); } for (var i = 0; i < startingCards.Count; i++) { CardPrototype card = startingCards[i]; DeckController.instance.PutOnTop(card.Instantiate()); } DeckController.instance.Shuffle(); }
static void CreateAsset() { CardPrototype asset = ScriptableObject.CreateInstance <CardPrototype>(); string path = AssetDatabase.GetAssetPath(Selection.activeObject); if (path == "") { path = "Assets"; } else if (Path.GetExtension(path) != "") { path = path.Replace(Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)), ""); } string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/New Card.asset"); AssetDatabase.CreateAsset(asset, assetPathAndName); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); EditorUtility.FocusProjectWindow(); Selection.activeObject = asset; }
public static void RegisterCard(CardPrototype card) { Prototypes.Add(card.Name, card); }