/// <summary> /// The Create. /// </summary> /// <param name="collection">The collection<see cref="FeatureCollection"/>.</param> /// <param name="scale">The scale<see cref="float"/>.</param> /// <param name="city">The city<see cref="GameObject"/>.</param> public override void Create(dynamic collection, float scale, GameObject city) { var parent = CityGeneratorHelper.GetParentTransformFromCity(city, CityElements.Water); var buildingFeature = CityGeneratorHelper.GetFeatureBasedOnPropertyValueName(collection, _idName); if (buildingFeature == null) { return; } var polygon = CityGeneratorHelper.GetPolygonsFromFeature(buildingFeature); Mesh mesh = CityGeneratorHelper.CreateMeshFromGeoJsonPolygon(polygon, _waterPrefab, parent, scale); string folderName = AssetFolderHelper.CreateFolderToSaveCity(city, MeshFolder.Folder); AssetDatabase.CreateAsset(mesh, folderName + "water.asset"); }
/// <summary> /// The Create. /// </summary> /// <param name="collection">The collection<see cref="FeatureCollection"/>.</param> /// <param name="scale">The scale<see cref="float"/>.</param> /// <param name="city">The city<see cref="GameObject"/>.</param> public override void Create(dynamic collection, float scale, GameObject city) { var _parent = CityGeneratorHelper.GetParentTransformFromCity(city, CityElements.Rivers); var riversFeature = CityGeneratorHelper.GetFeatureBasedOnPropertyValueName(collection, idName); if (riversFeature == null) { return; } var polygons = CityGeneratorHelper.GetPolygonsFromFeature(riversFeature); foreach (var poly in polygons) { Vector3[] positions; var lineRenderer = MultiLineStringHandler.CreateLineRenderer(_riverPrefab, _parent); MultiLineStringHandler.UpdateLineRendererPoints(poly, out positions, scale, lineRenderer); } }
/// <summary> /// The Create. /// </summary> /// <param name="collection">The collection<see cref="FeatureCollection"/>.</param> /// <param name="scale">The scale<see cref="float"/>.</param> /// <param name="city">The city<see cref="GameObject"/>.</param> public override void Create(dynamic collection, float scale, GameObject city) { var parent = CityGeneratorHelper.GetParentTransformFromCity(city, CityElements.Walls); var wallFeature = CityGeneratorHelper.GetFeatureBasedOnPropertyValueName(collection, _idName); if (wallFeature == null) { return; } var lineStrings = CityGeneratorHelper.GetPolygonsFromFeature(wallFeature); if (_createWallsSeparately) { CreateWallsSeparately(scale, parent, lineStrings); } else { CreateContiniousWall(scale, parent, lineStrings); } }