fix: fix cached position for pre-warmed particles

pull/169/head
mob-sakai 2021-02-24 16:22:37 +09:00
parent b93e0e4701
commit e3f42d747a
2 changed files with 3 additions and 1 deletions

View File

@ -395,7 +395,6 @@ namespace Coffee.UIExtensions
#if !SERIALIZE_FIELD_MASKABLE #if !SERIALIZE_FIELD_MASKABLE
maskable = m_Maskable; maskable = m_Maskable;
#endif #endif
_cachedPosition = transform.position;
activeMeshIndices.Clear(); activeMeshIndices.Clear();
UIParticleUpdater.Register(this); UIParticleUpdater.Register(this);

View File

@ -154,6 +154,9 @@ namespace Coffee.UIExtensions
particle.cachedPosition = position; particle.cachedPosition = position;
if (particle.activeMeshIndices.CountFast() == 0)
diff = Vector3.zero;
for (var i = 0; i < particle.particles.Count; i++) for (var i = 0; i < particle.particles.Count; i++)
{ {
Profiler.BeginSample("[UIParticle] Bake Mesh > Push index"); Profiler.BeginSample("[UIParticle] Bake Mesh > Push index");