diff --git a/Assets/Scripts/Framework/Core/UnityTool.cs b/Assets/Scripts/Framework/Core/UnityTool.cs index d3c8b2da3..2947e7431 100644 --- a/Assets/Scripts/Framework/Core/UnityTool.cs +++ b/Assets/Scripts/Framework/Core/UnityTool.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using AibisDream; using UnityEngine; namespace Framework.Core @@ -120,13 +121,17 @@ namespace Framework.Core { if (dic.TryGetValue(type, out var components)) return components; + if (type.IsArray) + { + type = type.GetElementType(); + } + var selfComponent = mono.GetComponent(type); var childrenComponents = mono.GetComponentsInChildren(type, true); components = selfComponent != null ? new[] { selfComponent }.Concat(childrenComponents).ToArray() : childrenComponents; - - + if (components == null || components.Length == 0) { #if UNITY_EDITOR