fix getcomponentinchildrenwitherror
This commit is contained in:
parent
d47a03a36e
commit
1111f0d7a0
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue