public void LoadCard() { //Debug.Log("Load Card after click"); if (currentCard.value == null) { return; } cardViz.Load(currentCard.value.viz.card); cardViz.gameObject.SetActive(true); currentCard.value.gameObject.SetActive(false); }
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); }