mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 18:00:26 +00:00
增加Legend的itemInactiveOpacity可设置非激活状态时的颜色透明度 (#343)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
#if dUI_TextMeshPro
|
||||
using TMPro;
|
||||
#endif
|
||||
@@ -9,27 +10,37 @@ namespace XCharts.Runtime
|
||||
[Serializable]
|
||||
public class LegendTheme : ComponentTheme
|
||||
{
|
||||
[SerializeField] protected Color m_UnableColor;
|
||||
[SerializeField][FormerlySerializedAs("m_UnableColor")] protected Color m_InactiveColor;
|
||||
|
||||
/// <summary>
|
||||
/// the color of text.
|
||||
/// ||文本颜色。
|
||||
/// </summary>
|
||||
[Obsolete("Use inactiveColor instead.", true)]
|
||||
public Color unableColor
|
||||
{
|
||||
get { return m_UnableColor; }
|
||||
set { if (PropertyUtil.SetColor(ref m_UnableColor, value)) SetComponentDirty(); }
|
||||
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(); }
|
||||
}
|
||||
|
||||
public void Copy(LegendTheme theme)
|
||||
{
|
||||
base.Copy(theme);
|
||||
m_UnableColor = theme.unableColor;
|
||||
m_InactiveColor = theme.inactiveColor;
|
||||
}
|
||||
|
||||
public LegendTheme(ThemeType theme) : base(theme)
|
||||
{
|
||||
m_UnableColor = ColorUtil.GetColor("#cccccc");
|
||||
m_InactiveColor = ColorUtil.GetColor("#cccccc");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user