整理代码结构,支持Package Manager添加

This commit is contained in:
monitor1394
2019-10-22 04:09:04 +08:00
parent e4d47684f6
commit b2b4f1a65f
218 changed files with 197991 additions and 97171 deletions

View File

@@ -0,0 +1,42 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System;
using UnityEngine;
namespace XCharts
{
public class ChartComponent
{
[SerializeField] protected string m_JsonData;
[SerializeField] protected bool m_DataFromJson;
/// <summary>
/// json格式的字符串数据
/// </summary>
/// <returns></returns>
public string jsonData { get { return m_JsonData; } set { m_JsonData = value; ParseJsonData(value); } }
public void OnAfterDeserialize()
{
if (m_DataFromJson)
{
ParseJsonData(m_JsonData);
m_DataFromJson = false;
}
}
public void OnBeforeSerialize()
{
}
public virtual void ParseJsonData(string json)
{
throw new Exception("no support yet");
}
}
}