Files
XCharts/Runtime/Component/ChartComponent.cs

42 lines
1.1 KiB
C#
Raw Normal View History

/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
2019-10-14 18:13:08 +08:00
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); } }
internal void OnAfterDeserialize()
2019-10-14 18:13:08 +08:00
{
if (m_DataFromJson)
{
ParseJsonData(m_JsonData);
m_DataFromJson = false;
}
}
internal void OnBeforeSerialize()
2019-10-14 18:13:08 +08:00
{
}
public virtual void ParseJsonData(string json)
{
throw new Exception("no support yet");
}
}
}