Add Unity-style GetComponents scripting API

This commit is contained in:
2026-04-03 14:51:52 +08:00
parent 5225faff1d
commit 0f51f553c8
8 changed files with 240 additions and 10 deletions

View File

@@ -34,6 +34,11 @@ namespace XCEngine
return GameObject.GetComponent<T>();
}
public T[] GetComponents<T>() where T : Component
{
return GameObject.GetComponents<T>();
}
public T GetComponentInChildren<T>() where T : Component
{
return GameObject.GetComponentInChildren<T>();