Beispiel #1
0
    public void DestroyUnitInCell(HexCoordinates hcoords, int id)
    {
        int index = hcoords.X + hcoords.Z * width + hcoords.Z / 2;  // translate the X,Y,Z coordinates into the cells[] single-dimention array
        //Debug.Log($"I want to remove unit id {id} at {hcoords} which is cells[{index}/{cells.Length}]");
        HexCell cell = cells[index];                                // lookup HexCell object from it's cells[] index

        cell.DestroyStackableUnit(id);
    }