示例#1
0
    void DeleteFromTempSelection(Point3 p)
    {
        if (p.X < tempMin.X || p.X > tempMax.X || p.Y < tempMin.Y || p.Y > tempMax.Y || p.Z < tempMin.Z || p.Z > tempMax.Z)
        {
            tempMin = minCorner;
            tempMax = maxCorner;
        }
        else
        {
            tempMin = Point3.Max(minCorner, p);
            tempMax = Point3.Min(maxCorner, p + Point3.one);
        }

        UpdateLineRenderer();
    }
            public void UpdateBox()
            {
                Point3?point  = null;
                Point3?point2 = null;

                foreach (MovingBlock block in Blocks)
                {
                    point  = (point.HasValue ? Point3.Min(point.Value, block.Offset) : block.Offset);
                    point2 = (point2.HasValue ? Point3.Max(point2.Value, block.Offset) : block.Offset);
                }
                if (point.HasValue)
                {
                    Box = new Box(point.Value.X, point.Value.Y, point.Value.Z, point2.Value.X - point.Value.X + 1, point2.Value.Y - point.Value.Y + 1, point2.Value.Z - point.Value.Z + 1);
                }
                else
                {
                    Box = default(Box);
                }
            }
示例#3
0
 void AddToTempSelection(Point3 p)
 {
     tempMin = Point3.Min(minCorner, p);
     tempMax = Point3.Max(maxCorner, p + Point3.one);
     UpdateLineRenderer();
 }