public static Hearts Clamp(Hearts input, Hearts min, Hearts max) { int total = input.TotalPoints; int clamped = Mathf.Clamp(total, min.TotalPoints, max.TotalPoints); input.SetTotalPoints(clamped); return(input); }