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 onClick() { Unit u = player.getActiveUnit(); if (u != null) { player.gain(u.cost); player.clearActiveUnit(); player.rgo(); supply.setCurrentSupply(ally.getTotalActiveUnits()); } }