mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-21 07:50:16 +00:00
[optimize][textstyle] support sprite asset of TextMeshPro (#201)
This commit is contained in:
@@ -54,6 +54,7 @@
|
||||
|
||||
## master
|
||||
|
||||
* (2022.06.21) 增加`TextStyle`对`TextMeshPro`的`Sprite Asset`支持 (#201)
|
||||
* (2022.06.20) 优化`Tooltip`的边界限制 (#202)
|
||||
* (2022.06.20) 修复`TextMeshPro`开启时编译错误
|
||||
* (2022.06.20) 修复`Animation`的渐出动画不生效的问题
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_LineSpacing");
|
||||
#if dUI_TextMeshPro
|
||||
PropertyField(prop, "m_TMPFontStyle");
|
||||
PropertyField(prop, "m_TMPSpriteAsset");
|
||||
PropertyField(prop, "m_TMPAlignment");
|
||||
#else
|
||||
PropertyField(prop, "m_FontStyle");
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace XCharts.Runtime
|
||||
[SerializeField] private TMP_FontAsset m_TMPFont;
|
||||
[SerializeField] private FontStyles m_TMPFontStyle = FontStyles.Normal;
|
||||
[SerializeField] private TextAlignmentOptions m_TMPAlignment = TextAlignmentOptions.Left;
|
||||
[SerializeField] private TMP_SpriteAsset m_TMPSpriteAsset;
|
||||
#endif
|
||||
public bool show
|
||||
{
|
||||
@@ -154,6 +155,15 @@ namespace XCharts.Runtime
|
||||
get { return m_TMPAlignment; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_TMPAlignment, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the sprite asset of TextMeshPro.
|
||||
/// |TextMeshPro的Sprite Asset。
|
||||
/// </summary>
|
||||
public TMP_SpriteAsset tmpSpriteAsset
|
||||
{
|
||||
get { return m_TMPSpriteAsset; }
|
||||
set { if (PropertyUtil.SetClass(ref m_TMPSpriteAsset, value)) SetComponentDirty(); }
|
||||
}
|
||||
#endif
|
||||
|
||||
public TextStyle() { }
|
||||
@@ -198,6 +208,7 @@ namespace XCharts.Runtime
|
||||
#if dUI_TextMeshPro
|
||||
m_TMPFont = textStyle.tmpFont;
|
||||
m_TMPFontStyle = textStyle.tmpFontStyle;
|
||||
m_TMPSpriteAsset = textStyle.tmpSpriteAsset;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user