2021-01-11 08:54:28 +08:00
|
|
|
using System;
|
|
|
|
|
using UnityEngine;
|
2025-03-27 22:35:02 +08:00
|
|
|
using UnityEngine.Serialization;
|
2021-01-11 08:54:28 +08:00
|
|
|
#if dUI_TextMeshPro
|
|
|
|
|
using TMPro;
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-02-19 22:37:57 +08:00
|
|
|
namespace XCharts.Runtime
|
2021-01-11 08:54:28 +08:00
|
|
|
{
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class LegendTheme : ComponentTheme
|
|
|
|
|
{
|
2025-03-27 22:35:02 +08:00
|
|
|
[SerializeField][FormerlySerializedAs("m_UnableColor")] protected Color m_InactiveColor;
|
2021-01-11 08:54:28 +08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// the color of text.
|
2023-11-11 23:32:24 +08:00
|
|
|
/// ||文本颜色。
|
2021-01-11 08:54:28 +08:00
|
|
|
/// </summary>
|
2025-03-27 22:35:02 +08:00
|
|
|
[Obsolete("Use inactiveColor instead.", true)]
|
2021-01-11 08:54:28 +08:00
|
|
|
public Color unableColor
|
|
|
|
|
{
|
2025-03-27 22:35:02 +08:00
|
|
|
get { return m_InactiveColor; }
|
|
|
|
|
set { if (PropertyUtil.SetColor(ref m_InactiveColor, value)) SetComponentDirty(); }
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// the color when the component is inactive.
|
|
|
|
|
/// ||非激活状态时的颜色。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Color inactiveColor
|
|
|
|
|
{
|
|
|
|
|
get { return m_InactiveColor; }
|
|
|
|
|
set { if (PropertyUtil.SetColor(ref m_InactiveColor, value)) SetComponentDirty(); }
|
2021-01-11 08:54:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Copy(LegendTheme theme)
|
|
|
|
|
{
|
|
|
|
|
base.Copy(theme);
|
2025-03-27 22:35:02 +08:00
|
|
|
m_InactiveColor = theme.inactiveColor;
|
2021-01-11 08:54:28 +08:00
|
|
|
}
|
|
|
|
|
|
2021-11-23 13:20:07 +08:00
|
|
|
public LegendTheme(ThemeType theme) : base(theme)
|
2021-01-11 08:54:28 +08:00
|
|
|
{
|
2025-03-27 22:35:02 +08:00
|
|
|
m_InactiveColor = ColorUtil.GetColor("#cccccc");
|
2022-05-22 22:17:38 +08:00
|
|
|
|
2021-01-11 08:54:28 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|