feat: support IMeshModifier
Custom vertex effects and CompositeCanvasRenderer are supported close #282pull/289/head
parent
ac58475539
commit
5c3232faf3
|
@ -14,6 +14,7 @@ namespace Coffee.UIExtensions
|
||||||
[AddComponentMenu("")]
|
[AddComponentMenu("")]
|
||||||
internal class UIParticleRenderer : MaskableGraphic
|
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 CombineInstance[] s_CombineInstances = { new CombineInstance() };
|
||||||
private static readonly List<Material> s_Materials = new List<Material>(2);
|
private static readonly List<Material> s_Materials = new List<Material>(2);
|
||||||
private static MaterialPropertyBlock s_Mpb;
|
private static MaterialPropertyBlock s_Mpb;
|
||||||
|
@ -401,6 +402,14 @@ namespace Coffee.UIExtensions
|
||||||
workerMesh.SetColors(s_Colors);
|
workerMesh.SetColors(s_Colors);
|
||||||
Profiler.EndSample();
|
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();
|
Profiler.EndSample();
|
||||||
|
|
Loading…
Reference in New Issue