| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- 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);
- if (UserPlayer.ins == null) UserPlayer.LoginByToken();
- else UserPlayer.ins.GetUserInfo();
- }
- public void SetText(string text) {
- GetComponentInChildren<Text>().text = text;
- }
- }
|