From 11c3a7b37415d78e1b8ba3988a6e043c9f1861e0 Mon Sep 17 00:00:00 2001 From: mob-sakai Date: Fri, 10 Jun 2022 16:12:15 +0900 Subject: [PATCH] fix: when using linear color space, the particle colors are not output correctly To fix, set 'Apply Active Color Space' in renderer module to false. close #203 --- Scripts/Editor/UIParticleEditor.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Scripts/Editor/UIParticleEditor.cs b/Scripts/Editor/UIParticleEditor.cs index 21f2d83..15480fa 100644 --- a/Scripts/Editor/UIParticleEditor.cs +++ b/Scripts/Editor/UIParticleEditor.cs @@ -202,6 +202,24 @@ namespace Coffee.UIExtensions DestroyUIParticle(current); return; } + + // #203: When using linear color space, the particle colors are not output correctly. + // To fix, set 'Apply Active Color Space' in renderer module to false. + var allPsRenderers = targets.OfType() + .SelectMany(x => x.particles) + .Where(x => x) + .Select(x => x.GetComponent()) + .ToArray(); + if (0 < allPsRenderers.Length) + { + var so = new SerializedObject(allPsRenderers); + var sp = so.FindProperty("m_ApplyActiveColorSpace");//.boolValue = false; + if (FixButton(sp.boolValue || sp.hasMultipleDifferentValues, "When using linear color space, the particle colors are not output correctly.\nTo fix, set 'Apply Active Color Space' in renderer module to false.")) + { + sp.boolValue = false; + so.ApplyModifiedProperties(); + } + } } void DestroyUIParticle(UIParticle p, bool ignoreCurrent = false)