Skip to content

Commit a959fdd

Browse files
committed
fix: gradient color is not updated when calling the SetGradientKeys method
1 parent 32558d4 commit a959fdd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Packages/src/Runtime/UIEffect.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -952,11 +952,14 @@ public override void SetMaterialDirty()
952952
/// <summary>
953953
/// Set gradation gradient's keys.
954954
/// </summary>
955-
public void SetGradientKeys(GradientColorKey[] colorKeys, GradientAlphaKey[] alphaKeys)
955+
public void SetGradientKeys(GradientColorKey[] colorKeys, GradientAlphaKey[] alphaKeys,
956+
GradientMode mode = GradientMode.Blend)
956957
{
957958
m_GradationGradient ??= new Gradient();
958959
m_GradationGradient.SetKeys(colorKeys, alphaKeys);
960+
m_GradationGradient.mode = mode;
959961
context?.SetGradationDirty();
962+
SetVerticesDirty();
960963
}
961964

962965
protected override void UpdateContext(UIEffectContext c)

0 commit comments

Comments
 (0)