fix compile error on Unity 2021.1

pull/289/head
mob-sakai 2023-08-18 15:08:49 +09:00
parent db28f171f7
commit 28d8698597
1 changed files with 1 additions and 18 deletions
Scripts

View File

@ -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<T>(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<T>(this Component self, bool includeInactive) where T : Component
{
if (!self) return null;
if (!includeInactive) return self.GetComponentInChildren<T>();
var component = self.GetComponent<T>();
if (component) return component;
foreach (Transform child in self.transform)
{
component = child.GetComponentInChildren<T>(true);
if (component) return component;
}
return null;
}
#endif
}
}