private void SelectOff() { selectedUnit = null; unitControllerScript = null; //GUI selectedUnitName.text = ""; selectedUnitFaction.text = ""; selectedUnitIcon = null; selectedUnitHealth.text = ""; selectedUnitDamage.text = ""; selectedUnitArmor.text = ""; selectedUnitRange.text = ""; }
private void SelectOn(GameObject selectedGO) { selectedUnit = selectedGO; unitControllerScript = selectedGO.GetComponent <UnitControllerScript> (); //GUI selectedUnitName.text = unitControllerScript.unitName; selectedUnitFaction.text = unitControllerScript.faction; //selectedUnitIcon.texture = unitControllerScript.unitIcon.texture; selectedUnitHealth.text = unitControllerScript.healthPoints + "/" + unitControllerScript.maxHealth; selectedUnitDamage.text = unitControllerScript.damage.ToString(); selectedUnitArmor.text = unitControllerScript.meleeArmor + "/" + unitControllerScript.shootArmor; selectedUnitRange.text = unitControllerScript.range.ToString(); }