cull(engine-cleanup): pass-9 cascade round 2 after UIPanel stub

This commit is contained in:
gamer147
2026-07-03 23:30:59 -04:00
parent 36bd90c2b3
commit 18844b2233
11 changed files with 5 additions and 274 deletions

View File

@@ -228,13 +228,6 @@ public static class NGUITools
return gameObject.AddComponent<T>();
}
public static T AddChild<T>(GameObject parent, bool undo) where T : Component
{
GameObject gameObject = AddChild(parent, undo);
gameObject.name = GetTypeName<T>();
return gameObject.AddComponent<T>();
}
public static T AddWidget<T>(GameObject go, int depth = int.MaxValue) where T : UIWidget
{
if (depth == int.MaxValue)
@@ -353,23 +346,6 @@ public static class NGUITools
}
}
public static bool IsChild(Transform parent, Transform child)
{
if (parent == null || child == null)
{
return false;
}
while (child != null)
{
if (child == parent)
{
return true;
}
child = child.parent;
}
return false;
}
private static void Activate(Transform t, bool compatibilityMode)
{
SetActiveSelf(t.gameObject, state: true);
@@ -592,46 +568,6 @@ public static class NGUITools
return mSides;
}
public static Vector3[] GetWorldCorners(this Camera cam, float depth, Transform relativeTo)
{
if (cam.orthographic)
{
float orthographicSize = cam.orthographicSize;
float num = 0f - orthographicSize;
float num2 = orthographicSize;
float y = 0f - orthographicSize;
float y2 = orthographicSize;
Rect rect = cam.rect;
Vector2 vector = screenSize;
float num3 = vector.x / vector.y;
num3 *= rect.width / rect.height;
num *= num3;
num2 *= num3;
Transform transform = cam.transform;
Quaternion rotation = transform.rotation;
Vector3 position = transform.position;
mSides[0] = rotation * new Vector3(num, y, depth) + position;
mSides[1] = rotation * new Vector3(num, y2, depth) + position;
mSides[2] = rotation * new Vector3(num2, y2, depth) + position;
mSides[3] = rotation * new Vector3(num2, y, depth) + position;
}
else
{
mSides[0] = cam.ViewportToWorldPoint(new Vector3(0f, 0f, depth));
mSides[1] = cam.ViewportToWorldPoint(new Vector3(0f, 1f, depth));
mSides[2] = cam.ViewportToWorldPoint(new Vector3(1f, 1f, depth));
mSides[3] = cam.ViewportToWorldPoint(new Vector3(1f, 0f, depth));
}
if (relativeTo != null)
{
for (int i = 0; i < 4; i++)
{
mSides[i] = relativeTo.InverseTransformPoint(mSides[i]);
}
}
return mSides;
}
public static void Execute<T>(GameObject go, string funcName) where T : Component
{
T[] components = go.GetComponents<T>();