private static GameObject CreateMap() { GameObject map = new GameObject { name = "City Boundary" }; AbstractMap mapShape = map.AddComponent <AbstractMap>(); AbstractTileProvider tileProvider = map.AddComponent <ManhattanTiles>(); mapShape.Options.extentOptions.extentType = MapExtentType.Custom; mapShape.TileProvider = tileProvider; mapShape.InitializeOnStart = false; mapShape.Options.scalingOptions.scalingType = MapScalingType.WorldScale; mapShape.Options.placementOptions.placementType = MapPlacementType.AtTileCenter; mapShape.Options.placementOptions.snapMapToZero = true; ElevationLayerProperties elevation = new ElevationLayerProperties(); elevation.modificationOptions.sampleCount = 2; mapShape.Terrain.Update(elevation); mapShape.Terrain.SetElevationType(ElevationLayerType.FlatTerrain); CreateCity(mapShape); Object.DestroyImmediate(mapShape); Object.DestroyImmediate(tileProvider); return(map); }
public override void Initialize(ElevationLayerProperties elOptions) { _elevationOptions = elOptions; _meshData = new Dictionary <UnwrappedTileId, Mesh>(); _currentTileMeshData = new MeshData(); _stitchTargetMeshData = new MeshData(); var sampleCountSquare = _elevationOptions.modificationOptions.sampleCount * _elevationOptions.modificationOptions.sampleCount; _newVertexList = new List <Vector3>(sampleCountSquare); _newNormalList = new List <Vector3>(sampleCountSquare); _newUvList = new List <Vector2>(sampleCountSquare); _newTriangleList = new List <int>(); }
public override void Initialize(ElevationLayerProperties elOptions) { base.Initialize(elOptions); _meshSamples = new Dictionary <int, MeshDataArray>(); _dataArrays = new Dictionary <UnwrappedTileId, MeshDataArray>(); _cachedMeshDataArrays = new Dictionary <UnityTile, MeshDataArray>(); _meshData = new Dictionary <UnwrappedTileId, Mesh>(); _currentTileMeshData = new MeshData(); var sampleCountSquare = _elevationOptions.modificationOptions.sampleCount * _elevationOptions.modificationOptions.sampleCount; _newVertexList = new List <Vector3>(sampleCountSquare); _newNormalList = new List <Vector3>(sampleCountSquare); _newUvList = new List <Vector2>(sampleCountSquare); _newTriangleList = new List <int>(); }
public static void SetElevation(Elevation type, AbstractMap map) { ElevationLayerProperties elevation = new ElevationLayerProperties(); map.Terrain.EnableCollider(true); if (type == Elevation.Real) { elevation.modificationOptions.earthRadius = Constants.R * 1000; elevation.modificationOptions.sampleCount = 10; map.Terrain.Update(elevation); map.Terrain.SetElevationType(ElevationLayerType.TerrainWithElevation); return; } elevation.modificationOptions.sampleCount = 2; map.Terrain.Update(elevation); map.Terrain.SetElevationType(ElevationLayerType.FlatTerrain); }
public override void SetOptions(LayerProperties options) { _elevationOptions = (ElevationLayerProperties)options; }
public override void SetOptions(LayerProperties options) { _elevationOptions = (ElevationLayerProperties)options; Strategy.Initialize(_elevationOptions); }
public override void Initialize(ElevationLayerProperties elOptions) { _elevationOptions = elOptions; }
public virtual void Initialize(ElevationLayerProperties elOptions) { _elevationOptions = elOptions; }