mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-16 21:40:41 +00:00
57 lines
1.5 KiB
C#
57 lines
1.5 KiB
C#
|
|
using System.Collections;
|
|
using UnityEngine;
|
|
using UnityEngine.Networking;
|
|
|
|
namespace XCharts
|
|
{
|
|
public class XChartsMgr : MonoBehaviour
|
|
{
|
|
[SerializeField] private string m_Version;
|
|
[SerializeField] private string m_Date;
|
|
|
|
private XChartsMgr m_XCharts;
|
|
public XChartsMgr Instance
|
|
{
|
|
get
|
|
{
|
|
if (m_XCharts == null)
|
|
{
|
|
var go = new GameObject();
|
|
go.name = "_xcharts_";
|
|
m_XCharts = go.AddComponent<XChartsMgr>();
|
|
CheckVersion();
|
|
}
|
|
return m_XCharts;
|
|
}
|
|
}
|
|
|
|
private XChartsMgr() { }
|
|
|
|
private void Awake()
|
|
{
|
|
CheckVersion();
|
|
}
|
|
|
|
public void CheckVersion()
|
|
{
|
|
//StartCoroutine(GetVersion());
|
|
}
|
|
|
|
IEnumerator GetVersion()
|
|
{
|
|
var url = "https://raw.githubusercontent.com/monitor1394/unity-ugui-XCharts/master/README.md";
|
|
var web = new UnityWebRequest(url);
|
|
Debug.LogError(web.url);
|
|
yield return web.SendWebRequest();
|
|
if (web.isHttpError || web.isNetworkError)
|
|
Debug.LogError(web.error);
|
|
else
|
|
{
|
|
Debug.LogError(web.downloadedBytes);
|
|
Debug.LogError(web.downloadHandler.text);
|
|
web.Dispose();
|
|
}
|
|
}
|
|
}
|
|
} |