示例#1
0
 public static bool MatchCard(CardPrototype p1, CardPrototype p2)
 {
     if (p1.number >= 10)
     {
         return(p1.number == p2.number);
     }
     return(p1.number + p2.number == 10);
 }
示例#2
0
 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;
 }
示例#3
0
 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;
 }
示例#4
0
    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();
    }
示例#5
0
    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;
    }
示例#6
0
文件: Deck.cs 项目: pavelkouril/ld41
 public static void RegisterCard(CardPrototype card)
 {
     Prototypes.Add(card.Name, card);
 }