public List<GridPosition> GetValidActionGridPositionList()
{
List<GridPosition> validGridPositionList = new List<GridPosition>();
GridPosition unitGridPosition = unit.GetGridPosition();
for (int x = -maxMoveDistance; x <= maxMoveDistance; x++)
{
for(int z = -maxMoveDistance; z <= maxMoveDistance; z++)
{
GridPosition offsetGridPosition = new GridPosition(x, z);
GridPosition testGridPosition = unitGridPosition + offsetGridPosition;
Debug.Log(testGridPosition);
}
}
return validGridPositionList;
}
I am getting this issue x
and z
is getting 0 assigned at x = -maxMoveDistance
and z = -maxMoveDistance