This commit is contained in:
CortexCore
2024-04-06 16:33:32 +08:00
parent 637bbef7d2
commit 37e7fcea51
42 changed files with 597 additions and 149 deletions

View File

@@ -25,12 +25,17 @@ namespace BITKit.OpenWorld
var bounds1 = _collider.bounds;
size = bounds1.size;
offset = bounds1.center - transform.position;
return;
}
Bounds bounds = new();
foreach (var x in GetComponentsInChildren<Collider>())
{
bounds.Encapsulate(x.bounds);
if (x.bounds.size.sqrMagnitude > 64)
{
Debug.LogWarning($"{x.gameObject.name}:Size is too large, please check the size of the collider");
}
}
size = bounds.size;
offset = bounds.center - transform.position;