You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
fix: scaling ParticleSystem puts prewarmed particles in wrong location
close #235
This commit is contained in:
@@ -178,15 +178,18 @@ namespace Coffee.UIExtensions
|
||||
gameObject.layer = parent.gameObject.layer;
|
||||
|
||||
_particleSystem = particleSystem;
|
||||
_prewarm = _particleSystem.main.prewarm;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (Application.isPlaying)
|
||||
#endif
|
||||
if (_particleSystem.isPlaying)
|
||||
{
|
||||
_particleSystem.Clear();
|
||||
_particleSystem.Pause();
|
||||
if (_particleSystem.isPlaying || _prewarm)
|
||||
{
|
||||
_particleSystem.Clear();
|
||||
_particleSystem.Pause();
|
||||
}
|
||||
}
|
||||
_prewarm = _particleSystem.main.prewarm;
|
||||
|
||||
_renderer = particleSystem.GetComponent<ParticleSystemRenderer>();
|
||||
_renderer.enabled = false;
|
||||
|
||||
Reference in New Issue
Block a user