Skip to content

Commit

Permalink
fix: not working as expected in world simulation space
Browse files Browse the repository at this point in the history
close #98
  • Loading branch information
mob-sakai committed Sep 15, 2020
1 parent d59c72f commit 683fcb4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Packages/UIParticle/Scripts/UIParticleUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,14 @@ private static void BakeMesh(UIParticle particle)
var root = particle.transform;
var rootMatrix = Matrix4x4.Rotate(root.rotation).inverse
* Matrix4x4.Scale(root.lossyScale).inverse;
var scaleMatrix = particle.ignoreCanvasScaler
? Matrix4x4.Scale(particle.canvas.rootCanvas.transform.localScale.x * particle.scale * Vector3.one)
: Matrix4x4.Scale(particle.scale * Vector3.one);
var scale = particle.ignoreCanvasScaler
? particle.canvas.rootCanvas.transform.localScale.x * particle.scale
: particle.scale;
var scaleMatrix = Matrix4x4.Scale(scale * Vector3.one);

// Cache position
var position = particle.transform.position;
var diff = (position - particle.cachedPosition) * (1 - 1 / particle.scale);
var diff = (position - particle.cachedPosition) * (1 - 1 / scale);
particle.cachedPosition = position;

for (var i = 0; i < particle.particles.Count; i++)
Expand Down

0 comments on commit 683fcb4

Please sign in to comment.