Example #1
0
 public static Bounds SnapInward(this Bounds bounds, float inwardOffset = 0.0f)
 {
     return(BoundsEx.NewByMinAndMax(
                min: (bounds.min + inwardOffset.ToVector3()).Ceil(),
                max: (bounds.max - inwardOffset.ToVector3()).Floor()
                ));
 }
Example #2
0
 //============================================================
 public static Bounds WithThickness(this Bounds bounds, float thickness = 0.01f)
 {
     return(BoundsEx.NewByMinAndMax(bounds.min, new Vector3(bounds.max.x, bounds.max.y + thickness, bounds.max.z)));
 }
Example #3
0
 public static Bounds GetTopBounds(this Bounds bounds)
 {
     return(BoundsEx.NewByMinAndMax(new Vector3(bounds.min.x, bounds.max.y, bounds.min.z), bounds.max));
 }
Example #4
0
 //============================================================
 public static Bounds GetButtonBounds(this Bounds bounds)
 {
     return(BoundsEx.NewByMinAndMax(bounds.min, new Vector3(bounds.max.x, bounds.min.y, bounds.max.z)));
 }
Example #5
0
 //------------------------------------------------------------
 public static Bounds ScaleExtent(this Bounds bounds, Vector3 scalage)
 {
     return(BoundsEx.NewByExtent(bounds.center, Vector3.Scale(bounds.extents, scalage)));
 }
Example #6
0
 public static Bounds Extend(this Bounds bounds, Vector3 offset)
 {
     return(BoundsEx.NewByExtent(bounds.center, bounds.extents + offset));
 }