1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- 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()
- {
- Debug.Log("1111111");
- 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;
- Debug.Log("2222222");
- // 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;
- }
- }
|