You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
fix: nullptr exceptions when using nested UIParticle components in hierarchy
close #246
This commit is contained in:
@@ -286,7 +286,17 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
public void RefreshParticles(List<ParticleSystem> particles)
|
public void RefreshParticles(List<ParticleSystem> particles)
|
||||||
{
|
{
|
||||||
GetComponentsInChildren(m_Renderers);
|
// #246: Nullptr exceptions when using nested UIParticle components in hierarchy
|
||||||
|
m_Renderers.Clear();
|
||||||
|
foreach (Transform child in transform)
|
||||||
|
{
|
||||||
|
var uiParticleRenderer = child.GetComponent<UIParticleRenderer>();
|
||||||
|
|
||||||
|
if (uiParticleRenderer != null)
|
||||||
|
{
|
||||||
|
m_Renderers.Add(uiParticleRenderer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var j = 0;
|
var j = 0;
|
||||||
for (var i = 0; i < particles.Count; i++)
|
for (var i = 0; i < particles.Count; i++)
|
||||||
|
|||||||
Reference in New Issue
Block a user