Exemplo n.º 1
0
 public void Update()
 {
     //If Tile is heated it heats surrounding Tiles
     if (heated)
     {
         for (int x = -1; x <= 1; x++)
         {
             for (int y = -1; y <= 1; y++)
             {
                 Vector3Int position = new Vector3Int(Mathf.RoundToInt(transform.position.x) + x,
                                                      Mathf.RoundToInt(transform.position.y + y), 0);
                 HeatableTile temp = Level.instance.GetHeatableTile(position);
                 if (temp != null && !temp.heated && Level.instance.IgniteNeighbourTilePercent >= Random.value)
                 {
                     temp.HeatUp();
                 }
             }
         }
     }
     else if (ticks > ticksToHeatAgain)
     {
         sr.sprite = sprites[0];
     }
     else
     {
         ticks++;
     }
 }