Пример #1
0
 void Refresh()
 {
     if (chunk)
     {
         chunk.Refresh();
     }
 }
Пример #2
0
    void Refresh(bool selfOnly)
    {
        if (chunk)
        {
            chunk.Refresh();
            if (!selfOnly)
            {
                int prev_i = 3;
                for (int i = 0; i < neighbors.Length; i++)
                {
                    Cell neighbor = neighbors[i];
                    if (neighbor != null && neighbor.chunk != chunk)
                    {
                        neighbor.chunk.Refresh();

                        Cell corner_cell = neighbor.GetNeighbor((Direction)prev_i);
                        if (corner_cell != null && corner_cell.chunk != chunk)
                        {
                            corner_cell.chunk.Refresh();
                        }
                    }
                    prev_i = i;
                }
            }
        }
    }