You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 12:10:08 +00:00
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
This commit is contained in:
@@ -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<UIParticle>()
|
||||
.SelectMany(x => x.particles)
|
||||
.Where(x => x)
|
||||
.Select(x => x.GetComponent<ParticleSystemRenderer>())
|
||||
.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)
|
||||
|
||||
Reference in New Issue
Block a user