fixed options, fixed save, new Screenshots, v.140
This commit is contained in:
@@ -11,6 +11,7 @@ public class ContentGenerator : MonoBehaviour
|
||||
public GameObject grass;
|
||||
public GameObject boss;
|
||||
public GameObject npc;
|
||||
public GameObject house;
|
||||
static System.Random rand = new System.Random();
|
||||
|
||||
public GameObject generateEnemy()
|
||||
@@ -33,6 +34,8 @@ public class ContentGenerator : MonoBehaviour
|
||||
return generateRiverTileContent();
|
||||
case "Lake":
|
||||
return generateLakeTileContent();
|
||||
case "City":
|
||||
return generateCityTileContent();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -180,7 +183,7 @@ public class ContentGenerator : MonoBehaviour
|
||||
{
|
||||
GameObject result = gameObject;
|
||||
string name = json["objectname"].ToString().Replace("(Clone)", "");
|
||||
if (name.ToLower().Contains("stone"))
|
||||
if (name.ToLower().Contains("rock") || name.ToLower().Contains("ore"))
|
||||
{
|
||||
foreach (GameObject stone in stones)
|
||||
{
|
||||
@@ -191,7 +194,7 @@ public class ContentGenerator : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if(name.ToLower().Contains("tree"))
|
||||
{
|
||||
foreach (GameObject tree in trees)
|
||||
{
|
||||
@@ -202,6 +205,12 @@ public class ContentGenerator : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(name.ToLower().Contains("npc")){
|
||||
result = npc;
|
||||
}
|
||||
else if(name.ToLower().Contains("house")){
|
||||
result = house;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -251,4 +260,28 @@ public class ContentGenerator : MonoBehaviour
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public GameObject generateCityTileContent(){
|
||||
int chance = rand.Next(1, 101);
|
||||
if (chance < 10)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (chance >= 10 && chance < 40)
|
||||
{
|
||||
return house;
|
||||
}
|
||||
else if (chance >= 40 && chance < 65)
|
||||
{
|
||||
return trees[rand.Next(0, trees.Length)];
|
||||
}
|
||||
else if (chance >= 65 && chance < 90)
|
||||
{
|
||||
return stones[rand.Next(0, stones.Length)];
|
||||
}
|
||||
else
|
||||
{
|
||||
return npc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user