123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using TMPro;
- using UnityEngine;
- using UnityEngine.UI;
- namespace Assets
- {
-
- public enum RequestState
- {
- Success,
-
- HashFailed,
-
- MacFailed,
-
- TimeOut,
-
- Frequently,
-
- URLFailed,
- }
- public class DlgLoginFaild : BasePanel
- {
- public Button confirm;
- public TextMeshProUGUI faildMsg;
- RequestState requestState;
- public override void OnCloseWindow()
- {
- }
- public override void OnDestroyWindow()
- {
- }
- public override void OnInitWindow()
- {
- OnShowWindow();
- LanguageMatchManager.Instance.changeLanguage += () =>
- {
- faildMsg.text = LanguageMatchManager.Instance.GetLanByKey(requestState.ToString());
- };
- }
- public void Update()
- {
- }
- public override void OnShowWindow()
- {
- switch (StepManager.requestCode)
- {
- case 1:
-
- requestState = RequestState.URLFailed;
- break;
- case 1001:
-
- requestState = RequestState.MacFailed;
- break;
- case 1002:
-
- requestState = RequestState.URLFailed;
- break;
- case 1003:
-
- requestState = RequestState.URLFailed;
- break;
- case 1004:
-
- requestState = RequestState.HashFailed;
- break;
- case 1005:
-
- requestState = RequestState.MacFailed;
- break;
- case 1006:
-
- requestState = RequestState.MacFailed;
- break;
- case 1007:
-
- requestState = RequestState.URLFailed;
- break;
- case 1008:
-
- requestState = RequestState.URLFailed;
- break;
- }
- faildMsg.text = LanguageMatchManager.Instance.GetLanByKey(requestState.ToString());
- }
- private void Awake()
- {
- confirm.onClick.AddListener(() =>
- {
- UIManager.Instance.HideUI(WindowID.DlgLoginFaild);
- UIManager.Instance.HideUI(WindowID.DlgLoading);
- });
- }
- }
- }
|