static public void Blackhole(GameObject card) { CQBCard.UnitType type = card.GetComponent <CQBCard>().GetUnitType(); if (type == CQBCard.UnitType.CAPITAL || type == CQBCard.UnitType.FRIGATE) { Debug.Log("Applying Blackhole to " + card.name); int modifiedPower = card.GetComponent <CQBCard>().GetBasePower() / 2; card.GetComponent <CQBCard>().ActivateNegativeCost(modifiedPower); } }
static public void SuperNova(GameObject card) { CQBCard.UnitType type = card.GetComponent <CQBCard>().GetUnitType(); if (type == CQBCard.UnitType.FIGHTER || type == CQBCard.UnitType.CORVETTE) { Debug.Log("Applying Supernova to " + card.name); int modifiedPower = card.GetComponent <CQBCard>().GetBasePower() / 2; card.GetComponent <CQBCard>().ActivateNegativeCost(modifiedPower); } }
public List <GameObject> GetUnitCards(CQBCard.UnitType unitType) { List <GameObject> cards = new List <GameObject>(); GameObject card; for (int i = 0; i < transform.childCount; i++) { card = transform.GetChild(i).gameObject; if (card != null && card.GetComponent <CQBCard>().GetUnitType() == unitType) { cards.Add(card); } } return(cards); }