Pathfinding.GraphUpdateShape.GetBounds C# (CSharp) Method

GetBounds() public method

public GetBounds ( ) : Bounds
return UnityEngine.Bounds
		public Bounds GetBounds () {
			if (points == null || points.Length == 0) return new Bounds();
			Vector3 min = points[0];
			Vector3 max = points[0];
			for (int i=0;i<points.Length;i++) {
				min = Vector3.Min (min,points[i]);
				max = Vector3.Max (max,points[i]);
			}
			return new Bounds ((min+max)*0.5F,max-min);
		}
		

Usage Example

 // Token: 0x060022A1 RID: 8865 RVA: 0x00193904 File Offset: 0x00191B04
 public Bounds GetBounds()
 {
     if (this.points == null || this.points.Length == 0)
     {
         Collider   component  = base.GetComponent <Collider>();
         Collider2D component2 = base.GetComponent <Collider2D>();
         Renderer   component3 = base.GetComponent <Renderer>();
         Bounds     bounds;
         if (component != null)
         {
             bounds = component.bounds;
         }
         else if (component2 != null)
         {
             bounds      = component2.bounds;
             bounds.size = new Vector3(bounds.size.x, bounds.size.y, Mathf.Max(bounds.size.z, 1f));
         }
         else
         {
             if (!(component3 != null))
             {
                 return(new Bounds(Vector3.zero, Vector3.zero));
             }
             bounds = component3.bounds;
         }
         if (this.legacyMode && bounds.size.y < this.minBoundsHeight)
         {
             bounds.size = new Vector3(bounds.size.x, this.minBoundsHeight, bounds.size.z);
         }
         return(bounds);
     }
     return(GraphUpdateShape.GetBounds(this.convex ? this.convexPoints : this.points, (this.legacyMode && this.legacyUseWorldSpace) ? Matrix4x4.identity : base.transform.localToWorldMatrix, this.minBoundsHeight));
 }
All Usage Examples Of Pathfinding.GraphUpdateShape::GetBounds