From cef89e4b18074fb755e134e3c034806549cc06ab Mon Sep 17 00:00:00 2001 From: mob-sakai <sakai861104@gmail.com> Date: Tue, 15 Jan 2019 21:58:12 +0900 Subject: [PATCH] fix #34; With 'Screen Space - Camera' render mode, sorting is incorrect --- Assets/Coffee/UIExtensions/UIParticle/UIParticle.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Assets/Coffee/UIExtensions/UIParticle/UIParticle.cs b/Assets/Coffee/UIExtensions/UIParticle/UIParticle.cs index e9b3321..fe3a1a2 100755 --- a/Assets/Coffee/UIExtensions/UIParticle/UIParticle.cs +++ b/Assets/Coffee/UIExtensions/UIParticle/UIParticle.cs @@ -264,6 +264,16 @@ namespace Coffee.UIExtensions if (m_ParticleSystem && canvas) { + if (canvas.renderMode != RenderMode.ScreenSpaceOverlay) + { + Vector3 pos = rectTransform.localPosition; + if (Mathf.Abs (pos.z) < 0.01f) + { + pos.z = 0.01f; + rectTransform.localPosition = pos; + } + } + var rootCanvas = canvas.rootCanvas; Profiler.BeginSample ("Disable ParticleSystemRenderer"); if (Application.isPlaying)