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 = TextAutoLanguage2.GetTextByKey("home_loginAuth"); } transform.Find("BtnRetry").gameObject.SetActive(false); } public void SetRetryCount(int count) { if (gameObject.activeSelf) { GetComponentInChildren().text = string.Format(TextAutoLanguage2.GetTextByKey("home_loginAuthRetry"), count); } } public void SetAutoRetryFail() { if (gameObject.activeSelf) { GetComponentInChildren().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; } }