Ejemplo n.º 1
0
 /// <summary>
 /// Delete the cell at the given index.
 /// The user must handle the destructiuon of the component and the the gameobject associated.
 /// </summary>
 /// <param name="index"></param>
 public void DeleteCell(Cell cell)
 {
     if (_map != null)
     {
         _map.Remove(cell.GetIndex());
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Get the neighbours of a given cell. It check the possibles neighbours and add it to the returning list if the cell exists.
        /// It's not necessary that the cell passed was an existing cell in the grid.
        /// </summary>
        /// <param name="cell">The cell to check neighbours.</param>
        /// <returns>A list of cells that exist in the neighbours of the cell.</returns>
        public List <Cell> GetNeighboursCell(ref Cell cell)
        {
            Vector3Int index = cell.GetIndex();

            return(GetNeighboursCell(ref index));
        }