Esempio n. 1
0
    public IEnumerator GenerateTiles()
    {
        int i = 0;

        for (int x = 0; x < world.Border_X; x++)
        {
            for (int y = 0; y < world.Border_Y; y++)
            {
                Ground_tile gt = world.map[x, y];
                if (gt.type == ground_type.world_grass)
                {
                    continue;
                }

                tile_typ2e type = GetType(x, y, gt.type);
                SelectTileSprite(type, gt.type, gt.pos);
                i++;
                if (i % 10 == 0)
                {
                    yield return(new WaitForSeconds(Time.deltaTime));
                }
            }
        }

        yield return(null);
    }
Esempio n. 2
0
 public void SelectTileSprite(tile_typ2e type, ground_type gt, Vector2 pos)
 {
     if (gt == ground_type.sand)
     {
         foreach (Sprite s in sand)
         {
             if (s.name.Contains(type.ToString()))
             {
                 CreateTexture(pos, s, gt);
             }
         }
     }
 }