Skip to content

Commit 78fbdce

Browse files
committed
https://github.com/annulusgames/LitMotion/pull/232
Feature: color change for sprite SubMeshUI annulusgames#232
1 parent 835f04e commit 78fbdce

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/LitMotion/Assets/LitMotion.Animation/Runtime/Components/TextMeshProComponents.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ protected override void SetValue(TMP_Text target, in float value)
8282
target.color = c;
8383
}
8484
}
85+
[Serializable]
86+
[LitMotionAnimationComponentMenu("UI/TextMesh Pro/Color (For Sprite)")]
87+
public sealed class TMPTextColorCanvasRendererAnimation : ColorPropertyAnimationComponent<TextMeshProUGUI>
88+
{
89+
protected override Color GetValue(TextMeshProUGUI target) => target.canvasRenderer.GetColor();
90+
protected override void SetValue(TextMeshProUGUI target, in Color value)
91+
{
92+
target.havePropertiesChanged = true;
93+
target.canvasRenderer.SetColor(value);
94+
}
95+
}
8596
}
8697

8798
#endif

0 commit comments

Comments
 (0)