1
This commit is contained in:
@@ -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;
|
||||
|
@@ -26,7 +26,16 @@ namespace BITKit.OpenWorld
|
||||
var enabledCollider = arg2 is 0;
|
||||
foreach (var x in colliders)
|
||||
{
|
||||
x.enabled = enabledCollider;
|
||||
try
|
||||
{
|
||||
x.enabled = enabledCollider;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
BIT4Log.Warning<ColliderChunkObject>(gameObject.name);
|
||||
BIT4Log.LogException(e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
|
@@ -48,6 +48,7 @@ namespace BITKit.OpenWorld
|
||||
}
|
||||
protected virtual void OnTick(float deltaTime)
|
||||
{
|
||||
if (!enabled) return;
|
||||
while (_unregisterQueue.TryDequeue(out var obj))
|
||||
{
|
||||
_quadtree.Remove(obj);
|
||||
|
Reference in New Issue
Block a user