// public typelogic logic public virtual void OnSetType(CardViz viz) { Element t = Settings.GetResourcesManager().typeElement; CardVizProperties type = viz.GetProperty(t); type.text.text = typeName; }
public override void OnSetType(CardViz viz) { base.OnSetType(viz); int qtd = viz.HeroPropertiesHolder.Length; for (int i = 0; i < qtd; i++) { viz.HeroPropertiesHolder[i].SetActive(false); } }
void Start() { viz = GetComponent <CardViz>(); }
public void RPC_PlayerUsesCard(int instId, int photonId, CardOpertation operation) { NetworkPrint p = GetPlayer(photonId); Card card = p.GetCard(instId); switch (operation) { case CardOpertation.dropResourcesCard: Settings.SetParentForCard(card.cardPhysicalInst.transform, p.playerHolder.currentHolder.resourcesGrid.value); card.cardPhysicalInst.currentLogic = dataHolder.cardDownLogic; p.playerHolder.AddResourceCard(card.cardPhysicalInst.gameObject); card.cardPhysicalInst.gameObject.SetActive(true); break; case CardOpertation.pickCardFromDeck: GameObject go = Instantiate(dataHolder.cardPrefab) as GameObject; CardViz v = go.GetComponent <CardViz>(); v.LoadCard(card); card.cardPhysicalInst = go.GetComponent <CardInstance>(); card.cardPhysicalInst.currentLogic = dataHolder.handCard; card.cardPhysicalInst.owner = p.playerHolder; Settings.SetParentForCard(go.transform, p.playerHolder.currentHolder.handGrid.value); p.playerHolder.handCards.Add(card.cardPhysicalInst); break; case CardOpertation.dropCreatureCard: bool canUse = p.playerHolder.CanUseCard(card); if (canUse) { Settings.DropHeroCard(card.cardPhysicalInst.transform, p.playerHolder.currentHolder.downGrid.value, card.cardPhysicalInst); card.cardPhysicalInst.currentLogic = dataHolder.cardDownLogic; } else { Settings.RegisterEvent("Not enough resources to use card", Color.red); } card.cardPhysicalInst.gameObject.SetActive(true); break; case CardOpertation.setCardForBattle: if (p.playerHolder.attackingCards.Contains(card.cardPhysicalInst)) { p.playerHolder.attackingCards.Remove(card.cardPhysicalInst); p.playerHolder.currentHolder.SetCardsOffBatlleLine(card.cardPhysicalInst); } else { if (card.cardPhysicalInst.CanAttack()) { p.playerHolder.attackingCards.Add(card.cardPhysicalInst); p.playerHolder.currentHolder.SetCardsOnBatlleLine(card.cardPhysicalInst); } } break; case CardOpertation.cardToGraveyard: card.cardPhysicalInst.CardInstanceToGraveyard(); break; default: break; } }
public override void OnSetType(CardViz viz) { base.OnSetType(viz); }