mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-17 22:10:11 +00:00
发布1.0.0版本
This commit is contained in:
57
Scripts/Runtime/Utility/XChartsMgr.cs
Normal file
57
Scripts/Runtime/Utility/XChartsMgr.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Scripts/Runtime/Utility/XChartsMgr.cs.meta
Normal file
11
Scripts/Runtime/Utility/XChartsMgr.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4cbfef5a9a03149f6a1ddf4ebe502bf6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user