Ejemplo n.º 1
0
	/// <summary>
	/// Sets the unit as selected.
	/// The gridblock should call this after it is clicked.
	/// Passing null will deselect a unit.
	/// </summary>
	/// <param name="u">Unit.</param>
	public void setSelectedUnit(UnitScript u){
		//If another or no unit is selected.
		if(currentlySelectedUnit != u){
			currentlySelectedUnit = u;
			if(u != null){
				setButtons(u.getButtonPrefabs());
				timer.setUnitUsingTimer(u);
				timer.show();
			} else{ 
				resetButton();
				timer.hide();
			}
		}
	}