예제 #1
0
    private void AddTile(IVector3 position)
    {
        SelectionTile tile = new SelectionTile(position);

        for (int i = 0; i < m_tiles.Count; i++)
        {
            if (tile.center == m_tiles[i].center)
            {
                return;
            }
            SelectionTile tmp = m_tiles[i]; // annoyingly, [] is a function call that returns a copy
            tmp.AddNeighbor(ref tile);
            m_tiles[i] = tmp;               // write back to list
        }
        m_tiles.Add(tile);
    }