void OnDestroy()
 {
     if (RaycastHits.IsCreated)
     {
         RaycastHits.Dispose();
     }
     if (ColliderCastHits.IsCreated)
     {
         ColliderCastHits.Dispose();
     }
     if (DistanceHits.IsCreated)
     {
         DistanceHits.Dispose();
     }
     if (Collider.IsCreated)
     {
         Collider.Dispose();
     }
     if (ChildrenColliders.IsCreated)
     {
         for (int i = 0; i < ChildrenColliders.Length; i++)
         {
             ChildrenColliders[i].Dispose();
         }
         ChildrenColliders.Dispose();
     }
 }
예제 #2
0
 void OnDestroy()
 {
     if (RaycastHits.IsCreated)
     {
         RaycastHits.Dispose();
     }
     if (ColliderCastHits.IsCreated)
     {
         ColliderCastHits.Dispose();
     }
     if (DistanceHits.IsCreated)
     {
         DistanceHits.Dispose();
     }
 }