public void AddOrReplace(T obj, Vector3i pos) { Vector3i newMin = Vector3i.Min(min, pos); Vector3i newMax = Vector3i.Max(max, pos + Vector3i.one); if (newMin != min || newMax != max) { Resize(newMin, newMax); } Set(obj, pos); }
public void AddOrReplace(T obj, Vector3i pos) { if (minUnInitialized) { min = pos; } if (maxUnInitialized) { max = pos; } Vector3i newMin = Vector3i.Min(min, pos); Vector3i newMax = Vector3i.Max(max, pos + Vector3i.one); if ((newMin != min || newMax != max) || (minUnInitialized || maxUnInitialized)) { Resize(newMin, newMax); } Set(obj, pos); minUnInitialized = false; maxUnInitialized = false; }