You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
feat: ignore rendering of particle systems that do not have a SharedMaterial and TrailMaterial
Close #118
This commit is contained in:
@@ -164,6 +164,8 @@ namespace Coffee.UIExtensions
|
||||
// No particle to render.
|
||||
var currentPs = particle.particles[i];
|
||||
if (!currentPs || !currentPs.IsAlive() || currentPs.particleCount == 0) continue;
|
||||
var r = currentPs.GetComponent<ParticleSystemRenderer>();
|
||||
if (!r.sharedMaterial && !r.trailMaterial) continue;
|
||||
|
||||
// Calc matrix.
|
||||
Profiler.BeginSample("[UIParticle] Bake Mesh > Calc matrix");
|
||||
@@ -218,7 +220,6 @@ namespace Coffee.UIExtensions
|
||||
#endif
|
||||
|
||||
// Bake main particles.
|
||||
var r = currentPs.GetComponent<ParticleSystemRenderer>();
|
||||
if (CanBakeMesh(r))
|
||||
{
|
||||
Profiler.BeginSample("[UIParticle] Bake Mesh > Bake Main Particles");
|
||||
|
||||
Reference in New Issue
Block a user