123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using System;
- using LitJson;
- /*
- * 点云项目需要运行在联网环境中
- */
- public class Root : MonoBehaviour
- {
- private bool m_IsSelect;
- private float time = 0;
- void Start()
- {
- LitJson.JsonMapper.RegisterImporter<int, string>((int input) => { return input.ToString(); });
- LitJson.JsonMapper.RegisterImporter<string, int>((string input) => { return Int32.Parse(input); });
- LitJson.JsonMapper.RegisterImporter<float, Double>((float input) => { return (double)(input); });
- m_IsSelect = false;
- // PlayerPrefs.DeleteAll();
- UIManager.Instance.Init();
- var connect = API_Module_NetStatus.IsConnect();
- if (connect)
- {
- UIManager.Instance.ShowUI(UINameConfig.LoginPanel, typeof(LoginPanel));
- }
- else
- {
- //增加提示面板
- StartCoroutine(NetEnumerator());
- }
- WriteLog.ConsoleLog.LogStart();
- }
- private void Update()
- {
- if (API_GSXR_Slam.GSXR_Get_Head() != null && !m_IsSelect)
- {
- time += Time.deltaTime;
- UIManager.Instance.ChangePos();
- if (time >= 0.5f)
- {
- m_IsSelect = true;
- time = 0;
- }
- }
- }
- IEnumerator NetEnumerator()
- {
- while (!API_Module_NetStatus.IsConnect())
- {
- yield return null;
- }
- //网络连接成功后的操作
- UIManager.Instance.ShowUI(UINameConfig.LoginPanel, typeof(LoginPanel));
- yield break;
- }
- }
|