Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
    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;
    }