public static void LeftClick(Vector3 startingMousePosition, Vector3 endingMousePosition, RaycastHit hit) { //click if (startingMousePosition == endingMousePosition) { switch (hit.transform.gameObject.layer) { case unitLayer: PlayerUnits.DeselectAll(); PlayerUnits.SingleSelect(hit.collider.gameObject); break; case movableLayer: PlayerUnits.MoveSelected(hit.point); break; case buildingLayer: PlayerBuildings.Select(hit.collider.gameObject); break; default: break; } } //drag else { PlayerUnits.BoxSelect(startingMousePosition); } }
public BuilderManager(DataBuilderPrefab dataBuilderPrefab, Border border, PlayerBuildings playerBuildings, ICheckBeforeBuild checkBeforeBuild, IBuilder builder) { _dataBuilderPrefab = dataBuilderPrefab; _checkBeforeBuild = checkBeforeBuild; _builder = builder; _border = border; _playerBuildings = playerBuildings; }
public BuildingBase GetBuilding(int planetId, BuildingType type) => PlayerBuildings.First(b => b.BelongsTo.Id == planetId && b.Type == type);
public static void RightClick() { PlayerUnits.DeselectAll(); PlayerBuildings.Deselect(); }