You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
fix compile error on Unity 2021.1
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user