// This one is so that when a thing is destroyed, this can be called public static void DeselectSelectable(Selectable currentSelectable) { if (selected.Count > 0) { if (selected[0].gameObject == currentSelectable.gameObject) { if (selected[0].GetComponent <CommandStructure>() != null) { PlayerBuildingManager.CancelBuildingPlacement(); } selected.Remove(currentSelectable); UpdateDescription(); } else { selected.Remove(currentSelectable); } } }
public static void HandleRightClick(Vector2 clickedPos, string faction) { if (selected.Count > 0) { if (PlayerBuildingManager.isPlayerBuilding) { PlayerBuildingManager.PlaceBuilding(clickedPos); } else { if (selected[0].RightClickFunctionality != null) { foreach (Selectable current in selected) { current.RightClickFunctionality.HandleRightClick(clickedPos, faction); } } } } }
private void ClickButton() { PlayerBuildingManager.CancelBuildingPlacement(); PlayerBuildingManager.SetNewBuilding(attachedStructure); }
private void ReverseButtonClick() { SelectionManager.UpdateDescription(); PlayerBuildingManager.CancelBuildingPlacement(); }