Ejemplo n.º 1
0
    public Unit CreateUnitInCell(HexCoordinates hcoords, int id, UnitData data, bool altColor, int layer)
    {
        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 create a {data.unitType} at {hcoords} which is cells[{index}/{cells.Length}]");
        HexCell cell = cells[index];                                // lookup HexCell object from it's cells[] index

        return(cell.CreateStackableUnit(id, data, altColor, layer));
    }