Example #1
0
 private void SpawnChilds(TileBase tile)
 {
     for (int i = 0; i < ItemNum; i++)
     {
         int index = Random.Range(0, ItemList.Count);
         var item  = ItemList[index];
         tile.SpawnItem(item.gameObject, Random.Range(item.GetSpawnRange().x, item.GetSpawnRange().y));
     }
     for (int i = 0; i < ObstacleNum; i++)
     {
         int index    = Random.Range(0, ObstacleList.Count);
         var obstacle = ObstacleList[index];
         tile.SpawnItem(obstacle, 10f);
     }
 }