fix: mesh sharing not working

close #236
pull/289/head
mob-sakai 2023-08-14 15:44:04 +09:00
parent b308b26833
commit 8b4ca1add5
2 changed files with 7 additions and 7 deletions

View File

@ -298,6 +298,11 @@ namespace Coffee.UIExtensions
} }
} }
for (var i = 0; i < m_Renderers.Count; i++)
{
m_Renderers[i].Reset(i);
}
var j = 0; var j = 0;
for (var i = 0; i < particles.Count; i++) for (var i = 0; i < particles.Count; i++)
{ {
@ -308,11 +313,6 @@ namespace Coffee.UIExtensions
GetRenderer(j++).Set(this, particles[i], true); GetRenderer(j++).Set(this, particles[i], true);
} }
} }
for (; j < m_Renderers.Count; j++)
{
GetRenderer(j).Clear(j);
}
} }
internal void UpdateTransformScale() internal void UpdateTransformScale()
@ -400,7 +400,7 @@ namespace Coffee.UIExtensions
{ {
_tracker.Clear(); _tracker.Clear();
UIParticleUpdater.Unregister(this); UIParticleUpdater.Unregister(this);
m_Renderers.ForEach(r => r.Clear()); m_Renderers.ForEach(r => r.Reset());
UnregisterDirtyMaterialCallback(UpdateRendererMaterial); UnregisterDirtyMaterialCallback(UpdateRendererMaterial);
base.OnDisable(); base.OnDisable();

View File

@ -134,7 +134,7 @@ namespace Coffee.UIExtensions
return modifiedMaterial; return modifiedMaterial;
} }
public void Clear(int index = -1) public void Reset(int index = -1)
{ {
if (_renderer) if (_renderer)
{ {