Exemplo n.º 1
0
    void HandleInput()
    {
        Ray inputRay = Camera.main.ScreenPointToRay(Input.mousePosition);

        if (Physics.Raycast(inputRay, out RaycastHit hit))
        {
            EditCell(hexGrid.GetCell(CubeCoordinates.FromPosition(hit.point)));
        }
    }
Exemplo n.º 2
0
    public HexCell GetCell(Vector3 position)
    {
        OffsetCoordinates coordinates = OffsetCoordinates.FromCubeCoordinates(CubeCoordinates.FromPosition(position));

        return(cells[coordinates.X, coordinates.Z]);
    }