cull(engine-cleanup): pass-8 phase-2 cascade round 2 after GachaUI stub

This commit is contained in:
gamer147
2026-07-03 22:26:45 -04:00
parent e3b8b8dc0c
commit 78971adc46
26 changed files with 2 additions and 370 deletions

View File

@@ -13,34 +13,6 @@ public class CenteringUIWidget : MonoBehaviour
[SerializeField]
private bool _isCenteringVertical;
public void Reposition()
{
if (_offset == null || (!_isCenteringHorizontal && !_isCenteringVertical))
{
return;
}
UIWidget[] componentsInChildren = _offset.GetComponentsInChildren<UIWidget>();
if (componentsInChildren.Length != 0)
{
_offset.localPosition = Vector3.zero;
Bounds bounds = GetBounds(componentsInChildren[0], _offset);
for (int i = 1; i < componentsInChildren.Length; i++)
{
bounds.Encapsulate(GetBounds(componentsInChildren[i], _offset));
}
Vector3 localPosition = _offset.localPosition;
if (_isCenteringHorizontal)
{
localPosition.x = 0f - bounds.center.x;
}
if (_isCenteringVertical)
{
localPosition.y = 0f - bounds.center.y;
}
_offset.localPosition = localPosition;
}
}
private static Bounds GetBounds(UIWidget widget, Transform parent)
{
if (!(widget is UILabel))