Skip to content

Commit

Permalink
feat: support for particle systems including trail only
Browse files Browse the repository at this point in the history
Close #61
  • Loading branch information
mob-sakai committed Aug 17, 2020
1 parent 77c056a commit f389d39
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Packages/UIParticle/Scripts/UIParticle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,6 @@ void UpdateMesh()

Profiler.EndSample();

// #69: Editor crashes when mesh is set to null when ParticleSystem.RenderMode=Mesh
if (_renderer.renderMode == ParticleSystemRenderMode.Mesh && !_renderer.mesh)
return;

// #61: When ParticleSystem.RenderMode=None, an error occurs
if (_renderer.renderMode == ParticleSystemRenderMode.None)
return;

Profiler.BeginSample("Make Matrix");
ParticleSystem.MainModule main = m_ParticleSystem.main;
scaleaMatrix = main.scalingMode == ParticleSystemScalingMode.Hierarchy
Expand Down Expand Up @@ -503,6 +495,20 @@ void UpdateMesh()
}
else
{
// #69: Editor crashes when mesh is set to null when ParticleSystem.RenderMode=Mesh
if (_renderer.renderMode == ParticleSystemRenderMode.Mesh && !_renderer.mesh)
{
Profiler.EndSample();
return;
}

// #61: When ParticleSystem.RenderMode=None, an error occurs
if (_renderer.renderMode == ParticleSystemRenderMode.None)
{
Profiler.EndSample();
return;
}

_renderer.BakeMesh(s_CombineInstances[0].mesh, cam, true);
}

Expand Down

0 comments on commit f389d39

Please sign in to comment.