public static void UpdateMax(this ivec3 item, ref ivec3 currentMax) { if (currentMax.x < item.x) { currentMax.x = item.x; } if (currentMax.y < item.y) { currentMax.y = item.y; } if (currentMax.z < item.z) { currentMax.z = item.z; } }