|
@@ -1,6 +1,9 @@
|
|
|
+using Assets;
|
|
|
+using LitJson;
|
|
|
using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using UnityEngine;
|
|
|
+using UnityEngine.Networking;
|
|
|
using UnityEngine.SceneManagement;
|
|
|
using YooAsset;
|
|
|
|
|
@@ -14,6 +17,11 @@ public class GameManager : MonoBehaviour
|
|
|
private YooAssetManager m_YooAssetManager;
|
|
|
private CharacterManager m_CharacterManager;
|
|
|
private StepManager m_StepManager;
|
|
|
+ public WhiteList whiteList;
|
|
|
+ /// <summary>
|
|
|
+ /// °×Ãûµ¥URL
|
|
|
+ /// </summary>
|
|
|
+ string urlWhiteList = "https://sfgdemo-1303083714.cos.ap-hongkong.myqcloud.com/WhiteList.json";
|
|
|
private async void Awake()
|
|
|
{
|
|
|
Debug.Log("½øÈëGameManager");
|
|
@@ -31,8 +39,26 @@ public class GameManager : MonoBehaviour
|
|
|
m_AudioManager = gameObject.AddComponent<AudioManager>();
|
|
|
m_CharacterManager = gameObject.AddComponent<CharacterManager>();
|
|
|
m_StepManager= gameObject.AddComponent<StepManager>();
|
|
|
+ StartCoroutine(GetWhiteList());
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// ÇëÇó°×Ãûµ¥
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ IEnumerator GetWhiteList()
|
|
|
+ {
|
|
|
+ UnityWebRequest request = UnityWebRequest.Get(urlWhiteList);
|
|
|
+ yield return request.SendWebRequest();
|
|
|
+ if (request.result == UnityWebRequest.Result.Success)
|
|
|
+ {
|
|
|
+ whiteList = JsonMapper.ToObject<WhiteList>(request.downloadHandler.text);
|
|
|
+ StepManager.timeStamp = whiteList.TimeStamp;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Debug.Log(request.error);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
-
|
|
|
public GameManager GetGameManager() { return this; }
|
|
|
}
|