diff --git a/Scripts/Utils.cs b/Scripts/Utils.cs index 7736a94..59cf2b1 100644 --- a/Scripts/Utils.cs +++ b/Scripts/Utils.cs @@ -245,7 +245,7 @@ namespace Coffee.UIParticleExtensions } } -#if !UNITY_2020_3_OR_NEWER +#if !UNITY_2021_2_OR_NEWER || UNITY_2020_3_45 || UNITY_2020_3_46 || UNITY_2020_3_47 || UNITY_2020_3_48 public static T GetComponentInParent(this Component self, bool includeInactive) where T : Component { if (!self) return null; @@ -261,23 +261,6 @@ namespace Coffee.UIParticleExtensions return null; } - - public static T GetComponentInChildren(this Component self, bool includeInactive) where T : Component - { - if (!self) return null; - if (!includeInactive) return self.GetComponentInChildren(); - - var component = self.GetComponent(); - if (component) return component; - - foreach (Transform child in self.transform) - { - component = child.GetComponentInChildren(true); - if (component) return component; - } - - return null; - } #endif } }