fix #34; With 'Screen Space - Camera' render mode, sorting is incorrect

pull/77/head
mob-sakai 2019-01-15 21:58:12 +09:00
parent 9fe4cc7624
commit 566b479a37
1 changed files with 10 additions and 0 deletions

View File

@ -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)