| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- //遮罩-认证登录时用到
- public class AuthLoginMask : MonoBehaviour
- {
- public static AuthLoginMask ins;
- void Awake()
- {
- ins = this;
- SetVisiable(false);
- }
- void OnDestroy()
- {
- if (ins == this) ins = null;
- }
- public bool IsVisiable() {
- return gameObject.activeSelf;
- }
- public void SetVisiable(bool visiable) {
- gameObject.SetActive(visiable);
- if (visiable) {
- GetComponentInChildren<Text>().text =
- TextAutoLanguage2.GetTextByKey("home_loginAuth");
- }
- transform.Find("BtnRetry").gameObject.SetActive(false);
- }
- public void SetRetryCount(int count) {
- if (gameObject.activeSelf) {
- GetComponentInChildren<Text>().text =
- string.Format(TextAutoLanguage2.GetTextByKey("home_loginAuthRetry"), count);
- }
- }
- public void SetAutoRetryFail()
- {
- if (gameObject.activeSelf) {
- GetComponentInChildren<Text>().text =
- TextAutoLanguage2.GetTextByKey("home_loginAuthFail");
- transform.Find("BtnRetry").gameObject.SetActive(true);
- }
- }
- public void OnClick_Retry()
- {
- AudioMgr.ins.PlayBtn();
- SetVisiable(true);
- UserPlayer.ins.RetryRequestUserInfoAvoidFail();
- }
- public void SetText(string text) {
- GetComponentInChildren<Text>().text = text;
- }
- }
|