Files
XCharts/Runtime/Internal/Basic/BaseSerie.cs

91 lines
2.3 KiB
C#
Raw Normal View History

2019-10-14 18:13:08 +08:00
using System;
2021-11-23 13:20:07 +08:00
using System.Collections.Generic;
using System.Text;
2019-10-14 18:13:08 +08:00
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 abstract class BaseSerie
2019-10-14 18:13:08 +08:00
{
public virtual bool vertsDirty { get { return m_VertsDirty; } }
public virtual bool componentDirty { get { return m_ComponentDirty; } }
2021-11-23 13:20:07 +08:00
public virtual bool useDataNameForColor { get { return false; } }
2022-04-09 11:03:41 +08:00
public virtual bool useSortData { get { return false; } }
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; }
2021-11-23 13:20:07 +08:00
[NonSerialized] protected bool m_VertsDirty;
[NonSerialized] protected bool m_ComponentDirty;
[NonSerialized] protected Painter m_Painter;
[NonSerialized] public SerieContext context = new SerieContext();
2021-12-23 13:23:18 +08:00
[NonSerialized] public InteractData interact = new InteractData();
2021-11-23 13:20:07 +08:00
2022-03-04 22:17:32 +08:00
public SerieHandler handler { get; set; }
2021-11-23 13:20:07 +08:00
2021-05-16 23:38:06 +08:00
public virtual void SetVerticesDirty()
{
m_VertsDirty = true;
}
2021-05-16 23:38:06 +08:00
public virtual void ClearVerticesDirty()
{
m_VertsDirty = false;
}
2021-05-16 23:38:06 +08:00
public virtual void SetComponentDirty()
{
m_ComponentDirty = true;
}
2021-05-16 23:38:06 +08:00
public virtual void ClearComponentDirty()
{
m_ComponentDirty = false;
}
2021-11-23 13:20:07 +08:00
public virtual void ClearData()
{
}
public virtual void ClearDirty()
{
ClearVerticesDirty();
ClearComponentDirty();
}
public virtual void SetAllDirty()
{
SetVerticesDirty();
SetComponentDirty();
}
2021-01-11 08:54:28 +08:00
2021-11-23 13:20:07 +08:00
public virtual void OnRemove()
{
if (handler != null)
handler.RemoveComponent();
}
2021-01-11 08:54:28 +08:00
2022-03-04 22:17:32 +08:00
public virtual void OnDataUpdate()
{
}
public virtual void OnBeforeSerialize()
{
}
public virtual void OnAfterDeserialize()
{
OnDataUpdate();
}
2021-11-23 13:20:07 +08:00
public void RefreshLabel()
{
if (handler != null)
handler.RefreshLabelNextFrame();
}
2021-01-11 08:54:28 +08:00
}
2019-10-14 18:13:08 +08:00
}