fix getcomponentinchildrenwitherror

This commit is contained in:
Lillith Rose 2026-01-25 20:12:57 -05:00
parent d47a03a36e
commit 1111f0d7a0

View file

@ -1,3 +1,4 @@
using System.Linq;
using UnityEngine;
namespace gay.lilyy.Common
@ -41,7 +42,7 @@ namespace gay.lilyy.Common
{
if (root == null) return null;
T[] components = root.GetComponentsInChildren<T>(true);
T[] components = root.GetComponentsInChildren<T>(true).Concat(root.GetComponents<T>()).ToArray();
if (components.Length == 0)
{
return null;