2019-10-22 04:09:04 +08:00
|
|
|
|
2019-10-14 18:13:08 +08:00
|
|
|
using System;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
2022-02-19 22:37:57 +08:00
|
|
|
namespace XCharts.Runtime
|
2019-10-14 18:13:08 +08:00
|
|
|
{
|
2021-11-23 13:20:07 +08:00
|
|
|
[System.Serializable]
|
|
|
|
|
public class ChildComponent
|
2019-10-14 18:13:08 +08:00
|
|
|
{
|
2022-03-04 22:17:32 +08:00
|
|
|
public virtual int index { get; set; }
|
2020-03-05 20:25:19 +08:00
|
|
|
[NonSerialized] protected bool m_VertsDirty;
|
|
|
|
|
[NonSerialized] protected bool m_ComponentDirty;
|
2021-01-11 08:54:28 +08:00
|
|
|
[NonSerialized] protected Painter m_Painter;
|
2021-11-23 13:20:07 +08:00
|
|
|
|
2020-03-05 20:25:19 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 图表重绘标记。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public virtual bool vertsDirty { get { return m_VertsDirty; } }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 组件重新初始化标记。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public virtual bool componentDirty { get { return m_ComponentDirty; } }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 需要重绘图表或重新初始化组件。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool anyDirty { get { return vertsDirty || componentDirty; } }
|
2021-01-11 08:54:28 +08:00
|
|
|
public Painter painter { get { return m_Painter; } set { m_Painter = value; } }
|
|
|
|
|
public Action refreshComponent { get; set; }
|
|
|
|
|
public GameObject gameObject { get; set; }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
2021-05-16 23:38:06 +08:00
|
|
|
public virtual void SetVerticesDirty()
|
2020-03-05 20:25:19 +08:00
|
|
|
{
|
|
|
|
|
m_VertsDirty = true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-16 23:38:06 +08:00
|
|
|
public virtual void ClearVerticesDirty()
|
2020-03-05 20:25:19 +08:00
|
|
|
{
|
|
|
|
|
m_VertsDirty = false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-16 23:38:06 +08:00
|
|
|
public virtual void SetComponentDirty()
|
2020-03-05 20:25:19 +08:00
|
|
|
{
|
|
|
|
|
m_ComponentDirty = true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-16 23:38:06 +08:00
|
|
|
public virtual void ClearComponentDirty()
|
2020-03-05 20:25:19 +08:00
|
|
|
{
|
|
|
|
|
m_ComponentDirty = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void ClearDirty()
|
|
|
|
|
{
|
|
|
|
|
ClearVerticesDirty();
|
|
|
|
|
ClearComponentDirty();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void SetAllDirty()
|
|
|
|
|
{
|
|
|
|
|
SetVerticesDirty();
|
|
|
|
|
SetComponentDirty();
|
|
|
|
|
}
|
2019-10-14 18:13:08 +08:00
|
|
|
}
|
|
|
|
|
}
|