123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using LitJson;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using TMPro;
- using System;
- public class TopManager : MonoSingleton<TopManager>
- {
- public GameObject root;
- public GameObject icon;
- public TMP_Text timeText;
- private DateTime times;
- private Coroutine timeCoroutine;
- public void exitUser()
- {
- List<string> backTip = new List<string>();
- JsonData data = new JsonData();
- data["type"] = "40001";
- backTip.Add("1");
- backTip.Add(data.ToJson());
- backTip.Add("3");
- WindowsManager.Instance.show(WindowConfig.windowType.Error, false, WindowsManager.Instance.getErrorData("提示", "是否退出账号?", Color.gray, "icon", backTip, false, "自动退出", 5, "", "退出", "返回").ToJson());
- }
- public void exitUserOk()
- {
- if (ChangeCameraSaoMiao.Instance)
- {
- ChangeCameraSaoMiao.Instance.close();
- ChangeCameraSaoMiao.Instance.checkLuXiang();
- }
- if (LineManager.Instance)
- LineManager.Instance.stop();
- if (WindowGenSui.Instance)
- WindowGenSui.Instance.jd = 30;
- LoginManager.Instance.ExitUser();
- WindowsManager.Instance.show(WindowConfig.windowType.Login);
- }
- private void OnEnable()
- {
- if (TopManager.Instance.icon.transform.localPosition != Vector3.zero)
- {
- TopManager.Instance.root.SetActive(false);
- UserManager.Instance.MoveIcon(Vector3.zero, TopManager.Instance.icon.transform, () => { TopManager.Instance.root.SetActive(true); });
- }
- timeCoroutine= StartCoroutine(UpdataTimer());
- }
- private void OnDisable()
- {
- StopCoroutine(timeCoroutine);
- }
- private IEnumerator UpdataTimer()
- {
- while (true)
- {
- yield return new WaitForSeconds(1f);
- times = GetHttpTimer.Instance.GetTimer();
-
-
- timeText.text = times.Hour + ":" + times.Minute;
- }
- }
- }
|