3.0 - unitypackage

This commit is contained in:
monitor1394
2022-01-05 21:40:48 +08:00
parent c160867765
commit 228a4b2840
846 changed files with 105 additions and 467693 deletions

View File

@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
namespace XCharts
{
[System.Serializable]
public abstract class BaseSerie
{
public virtual bool vertsDirty { get { return m_VertsDirty; } }
public virtual bool componentDirty { get { return m_ComponentDirty; } }
public virtual bool useDataNameForColor { get { return false; } }
public bool anyDirty { get { return vertsDirty || componentDirty; } }
public Painter painter { get { return m_Painter; } set { m_Painter = value; } }
public Action refreshComponent { get; set; }
public GameObject gameObject { get; set; }
[NonSerialized] protected bool m_VertsDirty;
[NonSerialized] protected bool m_ComponentDirty;
[NonSerialized] protected Painter m_Painter;
[NonSerialized] public SerieContext context = new SerieContext();
[NonSerialized] public InteractData interact = new InteractData();
internal SerieHandler handler { get; set; }
public virtual void SetVerticesDirty()
{
m_VertsDirty = true;
}
public virtual void ClearVerticesDirty()
{
m_VertsDirty = false;
}
public virtual void SetComponentDirty()
{
m_ComponentDirty = true;
}
public virtual void ClearComponentDirty()
{
m_ComponentDirty = false;
}
public virtual void ClearData()
{
}
public virtual void ClearDirty()
{
ClearVerticesDirty();
ClearComponentDirty();
}
public virtual void SetAllDirty()
{
SetVerticesDirty();
SetComponentDirty();
}
public virtual void OnRemove()
{
if (handler != null)
handler.RemoveComponent();
}
public void RefreshLabel()
{
if (handler != null)
handler.RefreshLabelNextFrame();
}
#if UNITY_EDITOR
protected virtual void Reset()
{
}
protected virtual void OnValidate()
{
SetAllDirty();
}
#endif
}
}