fixed options, fixed save, new Screenshots, v.140
This commit is contained in:
@@ -11,7 +11,6 @@ using UnityEngine.UI;
|
||||
public class WorldGenerator : MonoBehaviour
|
||||
{
|
||||
public GameObject player;
|
||||
public GameObject city;
|
||||
public GameObject tile;
|
||||
Dictionary<Vector3, GameObject> tiles;
|
||||
GameObject currentTile;
|
||||
@@ -90,31 +89,22 @@ public class WorldGenerator : MonoBehaviour
|
||||
if (!tiles.ContainsKey(pos) && pos.y == 0)
|
||||
{
|
||||
GameObject newTile;
|
||||
string name;
|
||||
string name = "";
|
||||
int chance = rand.Next(1,11);
|
||||
Vector3 mapPos = new Vector3(pos.x * 100, 0, pos.z * 100);
|
||||
newTile = Instantiate(tile, mapPos, Quaternion.identity);
|
||||
if (chance == 1)
|
||||
{
|
||||
if (cityAmount > 0)
|
||||
{
|
||||
newTile = Instantiate(city, mapPos, Quaternion.identity);
|
||||
name = city.name;
|
||||
name = "City";
|
||||
cityAmount--;
|
||||
SteamWorksHandler.getStandardAchievement("CityAchievement");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
newTile = Instantiate(tile, mapPos, Quaternion.identity);
|
||||
name = tile.name;
|
||||
noise.applyNoise(newTile);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newTile = Instantiate(tile, mapPos, Quaternion.identity);
|
||||
noise.applyNoise(newTile, name);
|
||||
if(name.Length <= 0){
|
||||
name = tile.name;
|
||||
noise.applyNoise(newTile);
|
||||
}
|
||||
if (name.Contains("_"))
|
||||
{
|
||||
@@ -237,7 +227,7 @@ public class WorldGenerator : MonoBehaviour
|
||||
mapPos = new Vector3(pos.x * 100, 0, pos.z * 100);
|
||||
if (jsonData["tiletype"].ToString() == "CityTile")
|
||||
{
|
||||
loadedTile = Instantiate(city, mapPos, Quaternion.identity);
|
||||
loadedTile = Instantiate(tile, mapPos, Quaternion.identity);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -249,9 +239,9 @@ public class WorldGenerator : MonoBehaviour
|
||||
renderedTiles.Add(loadedTile);
|
||||
}
|
||||
currentTile = tiles[current];
|
||||
updateRenderedTiles();
|
||||
Vector3 position = new Vector3(currentTile.transform.position.x, 5, currentTile.transform.position.z);
|
||||
player.transform.SetPositionAndRotation(position, player.transform.rotation);
|
||||
updateRenderedTiles();
|
||||
}
|
||||
|
||||
public int getCityAmount()
|
||||
|
||||
Reference in New Issue
Block a user