private void RedrawBuildingPreview() { ClearPreviewGrid(); if (_building == null) { return; } Color color = _selectedBody.Buildings.IsValidBuilding(_building, _origin, _rotation) ? Color.white : InvalidPositionColor; foreach (BuildingTile tile in _building.Tiles) { Vector2Int position = _origin + CelestialBodyBuildings.Rotate(tile.Offset, _rotation); if (!_selectedBody.Buildings.InBounds(position)) { continue; } var image = _previewTiles[position.x][position.y].GetComponent <Image>(); image.sprite = tile.Sprite; image.color = color; image.transform.rotation = Quaternion.Euler(0, 0, 90 * _rotation); } }
public CelestialBodyLogic(GameState state, CelestialBody body) { _state = state; Body = body; Buildings = new CelestialBodyBuildings(this); Resources = new CelestialBodyResources(this); ShipQueue = new List <SpaceshipTemplate>(); }