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(); } }
void OnDestroy() { if (RaycastHits.IsCreated) { RaycastHits.Dispose(); } if (ColliderCastHits.IsCreated) { ColliderCastHits.Dispose(); } if (DistanceHits.IsCreated) { DistanceHits.Dispose(); } }