增加TooltipalwayShow参数设置触发后一直显示

This commit is contained in:
monitor1394
2020-06-04 07:46:07 +08:00
parent c18a7b99cb
commit be20dc2474
3 changed files with 8 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ namespace XCharts
[SerializeField] private float m_PaddingLeftRight = 5f;
[SerializeField] private float m_PaddingTopBottom = 5f;
[SerializeField] private string m_IgnoreDataDefaultContent = "-";
[SerializeField] private bool m_AlwayShow = true;
[SerializeField] private Sprite m_BackgroundImage;
[SerializeField] private TextStyle m_TextStyle = new TextStyle(18, FontStyle.Normal);
[SerializeField] private LineStyle m_LineStyle = new LineStyle(LineStyle.Type.Solid, 0.7f);
@@ -170,6 +171,10 @@ namespace XCharts
/// </summary>
public Sprite backgroundImage { get { return m_BackgroundImage; } set { m_BackgroundImage = value; SetBackground(m_BackgroundImage); } }
/// <summary>
/// 是否触发后一直显示。
/// </summary>
public bool alwayShow { get { return m_AlwayShow; } set { m_AlwayShow = value; } }
/// <summary>
/// 提示框内容文本样式。
/// </summary>
public TextStyle textStyle
@@ -383,6 +388,7 @@ namespace XCharts
/// <param name="flag"></param>
public void SetActive(bool flag)
{
if(!flag && m_AlwayShow) return;
lastDataIndex[0] = lastDataIndex[1] = -1;
if (m_GameObject && m_GameObject.activeInHierarchy != flag)
m_GameObject.SetActive(flag);