This commit is contained in:
CortexCore
2024-05-31 01:23:15 +08:00
parent c798b224be
commit 299082fe27
164 changed files with 3604 additions and 2018 deletions

View File

@@ -16,31 +16,6 @@ namespace BITKit.OpenWorld
base.OnLodChanged(oldLod, newLod);
OnLodChangedEvent?.Invoke(oldLod,newLod);
}
[BIT]
private void CalculateBounds()
{
if(TryGetComponent<Collider>(out var _collider))
{
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;
EditorUtility.SetDirty(this);
}
}
}