2019-10-22 04:09:04 +08:00
|
|
|
|
/******************************************/
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/* Copyright (c) 2018 monitor1394 */
|
|
|
|
|
|
/* https://github.com/monitor1394 */
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/******************************************/
|
|
|
|
|
|
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
|
|
namespace XCharts
|
|
|
|
|
|
{
|
|
|
|
|
|
[DisallowMultipleComponent]
|
|
|
|
|
|
[ExecuteInEditMode]
|
|
|
|
|
|
public class Demo_Test : MonoBehaviour
|
|
|
|
|
|
{
|
2019-11-30 21:24:04 +08:00
|
|
|
|
private float updateTime = 0;
|
|
|
|
|
|
CoordinateChart chart;
|
2019-10-22 04:09:04 +08:00
|
|
|
|
void Awake()
|
|
|
|
|
|
{
|
2019-11-30 21:24:04 +08:00
|
|
|
|
chart = gameObject.GetComponent<CoordinateChart>();
|
2019-10-22 04:09:04 +08:00
|
|
|
|
if (chart == null)
|
|
|
|
|
|
{
|
2019-11-30 21:24:04 +08:00
|
|
|
|
chart = gameObject.AddComponent<CoordinateChart>();
|
2019-10-22 04:09:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-11-30 21:24:04 +08:00
|
|
|
|
void Update()
|
2019-10-22 04:09:04 +08:00
|
|
|
|
{
|
2019-11-30 21:24:04 +08:00
|
|
|
|
updateTime += Time.deltaTime;
|
|
|
|
|
|
if (updateTime > 2)
|
2019-10-22 04:09:04 +08:00
|
|
|
|
{
|
2019-11-30 21:24:04 +08:00
|
|
|
|
updateTime = 0;
|
|
|
|
|
|
chart.UpdateData(0, Random.Range(0, 5), Random.Range(10, 90));
|
2019-10-22 04:09:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|