Skip to content

Commit

Permalink
feat: support IMeshModifier
Browse files Browse the repository at this point in the history
Custom vertex effects and CompositeCanvasRenderer are supported
close #282
  • Loading branch information
mob-sakai committed Dec 23, 2023
1 parent ac58475 commit 5c3232f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Scripts/UIParticleRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace Coffee.UIExtensions
[AddComponentMenu("")]
internal class UIParticleRenderer : MaskableGraphic
{
private static readonly List<Component> s_Components = new List<Component>();
private static readonly CombineInstance[] s_CombineInstances = { new CombineInstance() };
private static readonly List<Material> s_Materials = new List<Material>(2);
private static MaterialPropertyBlock s_Mpb;
Expand Down Expand Up @@ -401,6 +402,14 @@ public void UpdateMesh(Camera bakeCamera)
workerMesh.SetColors(s_Colors);
Profiler.EndSample();
}

GetComponents(typeof(IMeshModifier), s_Components);
for (var i = 0; i < s_Components.Count; i++)
{
((IMeshModifier)s_Components[i]).ModifyMesh(workerMesh);
}

s_Components.Clear();
}

Profiler.EndSample();
Expand Down

0 comments on commit 5c3232f

Please sign in to comment.