12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- 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 button;
- 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.TimeOut;
- break;
- case 1003:
-
- requestState = RequestState.Frequently;
- break;
- case 1004:
-
- requestState = RequestState.HashFailed;
- break;
- }
-
- faildMsg.text = LanguageMatchManager.Instance.GetLanByKey(requestState.ToString());
- UIManager.Instance.HideUI(WindowID.DlgLoading);
- }
- private void Awake()
- {
- button.onClick.AddListener(() =>
- {
- UIManager.Instance.HideUI(WindowID.DlgLoginFaild);
- });
- }
- }
- }
|