From 9313489552b30f2e2b0b42a641f5e0502995b03d Mon Sep 17 00:00:00 2001
From: mob-sakai <sakai861104@gmail.com>
Date: Mon, 1 Feb 2021 23:21:22 +0900
Subject: [PATCH] fix: the trail is incorrect in SimulationSpace.Local

---
 Scripts/UIParticleUpdater.cs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Scripts/UIParticleUpdater.cs b/Scripts/UIParticleUpdater.cs
index 1428407..ef4f6e7 100755
--- a/Scripts/UIParticleUpdater.cs
+++ b/Scripts/UIParticleUpdater.cs
@@ -241,6 +241,10 @@ namespace Coffee.UIExtensions
                     var hash = currentPs.GetMaterialHash(true);
                     if (hash != 0)
                     {
+                        matrix = currentPs.main.simulationSpace == ParticleSystemSimulationSpace.Local
+                            ? matrix * Matrix4x4.Translate(-currentPs.transform.position)
+                            : matrix;
+
                         var m = MeshHelper.GetTemporaryMesh();
                         try
                         {