fix: sub-emitter particles may not render correctly in certain scenarios
close #348develop-preview^2
parent
67de3d1bd3
commit
8276684c3b
|
@ -548,6 +548,24 @@ namespace Coffee.UIExtensions
|
|||
* Matrix4x4.Scale(scale)
|
||||
* Matrix4x4.Translate(-psPos);
|
||||
}
|
||||
|
||||
if (_mainEmitter)
|
||||
{
|
||||
if (_mainEmitter.IsLocalSpace())
|
||||
{
|
||||
return Matrix4x4.Translate(psPos)
|
||||
* Matrix4x4.Scale(scale)
|
||||
* Matrix4x4.Translate(-psPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
psPos = _particleSystem.transform.position - _mainEmitter.transform.position;
|
||||
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))
|
||||
|
|
Loading…
Reference in New Issue