diff --git a/Assets/UIEffect/UIEffect.cs b/Assets/UIEffect/UIEffect.cs index bf689855..965e489f 100644 --- a/Assets/UIEffect/UIEffect.cs +++ b/Assets/UIEffect/UIEffect.cs @@ -403,7 +403,7 @@ public static string GetVariantName(Shader shader, ToneMode tone, ColorMode colo /// Append shadow vertices. /// * It is similar to Shadow component implementation. /// - static void _ApplyShadow(List verts, ref int start, ref int end, ShadowStyle mode, float toneLevel, float blur, Vector2 effectDistance, Color color, bool useGraphicAlpha) + void _ApplyShadow(List verts, ref int start, ref int end, ShadowStyle mode, float toneLevel, float blur, Vector2 effectDistance, Color color, bool useGraphicAlpha) { if (ShadowStyle.None == mode) return; @@ -448,7 +448,7 @@ static void _ApplyShadow(List verts, ref int start, ref int end, Shado /// Append shadow vertices. /// * It is similar to Shadow component implementation. /// - static void _ApplyShadowZeroAlloc(List verts, ref int start, ref int end, float x, float y, Vector2 factor, Color color, bool useGraphicAlpha) + void _ApplyShadowZeroAlloc(List verts, ref int start, ref int end, float x, float y, Vector2 factor, Color color, bool useGraphicAlpha) { // Check list capacity. var neededCapacity = verts.Count + end - start; @@ -467,6 +467,12 @@ static void _ApplyShadowZeroAlloc(List verts, ref int start, ref int e vt.position.Set(v.x + x, v.y + y, v.z); Color vertColor = color; + + if(colorMode != ColorMode.None) + { + vertColor.r = vertColor.g = vertColor.b = 1; + } + vertColor.a = useGraphicAlpha ? color.a * vt.color.a / 255 : color.a; vt.color = vertColor;