public void onClick() { if (HexGM.isShoppingRound()) { if (unit != null) { if (GameObject.ReferenceEquals(player.activeUnitObject, this.gameObject)) { // deselect player.clearActiveUnit(); this.gameObject.GetComponent <Image>().color = unit.getTierColor(); } else { player.SetActiveUnit(unit, this.gameObject); player.rgo = new Player.ResetGameObject(resetDefault); } } else if (player.getActiveUnit() != null) { ally.checkBoardForThreeUnits(player.getActiveUnit()); setUnit(player.getActiveUnit()); player.clearActiveUnit(); player.rgo(); supply.setCurrentSupply(ally.getTotalActiveUnits()); } } }
public void takeDamage(Unit attacker) { if (!HexGM.isShoppingRound() && this.unit != null) { attacker.dealDamage(this.unit); if (unit.currentHealth <= 0) { this.resetDefault(); } } }
public void setState() { isShowing = !isShowing; if (isShowing) { shop.transform.localScale = Vector3.zero; ally.transform.localScale = boardScale; if (!HexGM.isShoppingRound()) { enemy.transform.localScale = boardScale; } } else { shop.transform.localScale = shopScale; ally.transform.localScale = Vector3.zero; if (!HexGM.isShoppingRound()) { enemy.transform.localScale = Vector3.zero; } } }