fix: trail incorrect offset

close #335
main
Jie 2024-10-10 19:42:26 +08:00 committed by mob-sakai
parent dd94bba43c
commit a4dd8c5776
1 changed files with 6 additions and 0 deletions

View File

@ -542,6 +542,12 @@ namespace Coffee.UIExtensions
return Matrix4x4.Translate(psPos)
* Matrix4x4.Scale(scale);
case ParticleSystemSimulationSpace.World:
if (_isTrail)
{
return Matrix4x4.Translate(psPos)
* Matrix4x4.Scale(scale)
* Matrix4x4.Translate(-psPos);
}
return Matrix4x4.Scale(scale);
case ParticleSystemSimulationSpace.Custom:
return Matrix4x4.Translate(_particleSystem.main.customSimulationSpace.position.GetScaled(scale))