mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-21 16:00:24 +00:00
XCharts 2.0
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
/******************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/******************************************/
|
||||
/************************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 - 2021 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/************************************************/
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
@@ -12,17 +12,9 @@ namespace XCharts
|
||||
{
|
||||
public class ChartComponent
|
||||
{
|
||||
[SerializeField] protected string m_JsonData;
|
||||
[SerializeField] protected bool m_DataFromJson;
|
||||
|
||||
[NonSerialized] protected bool m_VertsDirty;
|
||||
[NonSerialized] protected bool m_ComponentDirty;
|
||||
|
||||
/// <summary>
|
||||
/// json格式的字符串数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string jsonData { get { return m_JsonData; } set { m_JsonData = value; ParseJsonData(value); } }
|
||||
[NonSerialized] protected Painter m_Painter;
|
||||
/// <summary>
|
||||
/// 图表重绘标记。
|
||||
/// </summary>
|
||||
@@ -35,23 +27,9 @@ namespace XCharts
|
||||
/// 需要重绘图表或重新初始化组件。
|
||||
/// </summary>
|
||||
public bool anyDirty { get { return vertsDirty || componentDirty; } }
|
||||
internal void OnAfterDeserialize()
|
||||
{
|
||||
if (m_DataFromJson)
|
||||
{
|
||||
ParseJsonData(m_JsonData);
|
||||
m_DataFromJson = false;
|
||||
}
|
||||
}
|
||||
|
||||
internal void OnBeforeSerialize()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void ParseJsonData(string json)
|
||||
{
|
||||
throw new Exception("no support yet");
|
||||
}
|
||||
public Painter painter { get { return m_Painter; } set { m_Painter = value; } }
|
||||
public Action refreshComponent { get; set; }
|
||||
public GameObject gameObject { get; set; }
|
||||
|
||||
internal virtual void SetVerticesDirty()
|
||||
{
|
||||
@@ -85,4 +63,12 @@ namespace XCharts
|
||||
SetComponentDirty();
|
||||
}
|
||||
}
|
||||
|
||||
public class MainComponent : ChartComponent
|
||||
{
|
||||
}
|
||||
|
||||
public class SubComponent : ChartComponent
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user