Пример #1
0
        Card CreateCardMaster(string cardId) //Creating card after drawing
        {
            Card card = rm.GetCardInstance(cardId);

            card.instId = cardInstanceIDs;
            cardInstanceIDs++;
            return(card);
        }
Пример #2
0
        void CreateStartingCards()
        {
            ResourcesManager rm = Settings.GetResourcesManager();

            for (int i = 0; i < currentPlayer.startingCards.Length; zi++)
            {
                GameObject go = Instantiate(cardPrefab) as GameObject;
                CardViz    v  = go.GetComponent <CardViz>();
                v.LoadCard(rm.GetCardInstance(currentPlayer.startingCards[i]));
                CardInstance inst = go.GetComponent <CardInstance>();
                inst.currentLogic = currentPlayer.handLogic;

                Settings.SetParentForCard(go.transform, currentPlayer.handGrid.value);
            }
        }
Пример #3
0
        public void PickNewCardFormDeck(PlayerHolder p)
        {
            if (p.allCards.Count == 0)
            {
                Debug.Log("Game Over");
                return;
            }
            string cardID = p.allCards[0];

            p.allCards.RemoveAt(0);
            ResourcesManager rm  = Settings.GetResourcesManager();
            GameObject       go  = Instantiate(cardPrefab) as GameObject;
            CardViz          viz = go.GetComponent <CardViz>();

            viz.Load(rm.GetCardInstance(cardID));
            CardInstance inst = go.GetComponent <CardInstance>();

            inst.currentLogic = p.handCardsLogic;
            inst.owner        = p;
            Settings.SetParentForCard(go.transform, p.currentHolder.handCardsGrid.value);
            p.handCards.Add(inst);
        }