private void Start() { _tileContainer = _tileContainerData; min = CalculateWorldPosition(Vector3.zero); max = CalculateWorldPosition(new Vector3(Screen.width, Screen.height, 0)); CoordinateSystem.width = _tileContainer.Layer(TileHeight.zero).meshSizeX; HexPoint start = CoordinateSystem.pixel_to_flat_hex(Vector3.zero, out start); CreateMap(start, _mapRadius); CoordinateSystem.isInitialized = true; }
private Transform PlacePrefab(HexPoint hPoint) { int currentProbability = Random.Range(0, 100); HexTile tile = null; TileData data = null; _tile = Instantiate(_groundTile, Vector3.zero, Quaternion.identity); _tile.transform.position = CoordinateSystem.HexPointToWorldCoordinate(hPoint); data = _tileContainer.Layer(TileHeight.zero); tile = new WaterTile(_tile, hPoint, data); tile._colorCoding = _tileFactory.defaultWaterTile._colorCoding; GlobalGameManager.instance.Map.Add(hPoint, tile); return(_tile.transform); }