private IEnumerator Generate_SinglePlayer() { int width = settings.width; int height = settings.height; map = new Map(width, height); starter.ChangeLoadingInfo("Initializing Tiles"); yield return(map.Setup()); yield return(GameObject.Find("LocalMap").GetComponent <LocalMap>().Setup(width, height)); starter.ChangeLoadingInfo("Building Rock Layers"); yield return(RockBase.AssignRockBases(map)); starter.ChangeLoadingInfo("Building LandMass"); starter.ChangeLoadingInfo("Building HeatMap"); starter.ChangeLoadingInfo("Building MoistureMap"); starter.ChangeLoadingInfo("Building Soil Layers"); starter.ChangeLoadingInfo("Building WorldMesh"); yield return(meshController.BuildMap(settings)); starter.ChangeLoadingInfo("Placing Players"); starter.GeneratorFinish(); }
public TileBorder uLBorder; //v5 and v0 public AnTile(int w, int h) { x = w; y = h; rockBase = null; float xShift = 0.0f; if (y % 2 != 0) { xShift += HexParams.shortRadius; } realY = y * HexParams.heightDistance; realX = (x * HexParams.shortDiameter) + xShift; }
public static IEnumerator AssignRockBases(Map m) { map = m; RockBase[] rockBase = new RockBase[] { new RockBase_Standard(), new RockBase_Biomass(), new RockBase_Volcanic(), new RockBase_Tectonic(), new RockBase_Crystalline() }; for (int h = 0; h < map.height; h++) { for (int w = 0; w < map.width; w++) { float chance = Random.Range(0.0f, 100.0f); if (chance < 1.0f) { rockBase[3].Build(w, h); } else if (chance < 4.0f) { rockBase[2].Build(w, h); } else if (chance < 9.0f) { rockBase[1].Build(w, h); } else if (chance < 10.0f) { rockBase[4].Build(w, h); } } yield return(null); } for (int h = 0; h < map.height; h++) { for (int w = 0; w < map.width; w++) { if (map.tileMap[h][w].rockBase == null) { rockBase[0].Build(w, h); } } yield return(null); } yield return(null); }