AuthLoginMask.cs 786 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. //遮罩-认证登录时用到
  6. public class AuthLoginMask : MonoBehaviour
  7. {
  8. public static AuthLoginMask ins;
  9. void Awake()
  10. {
  11. ins = this;
  12. SetVisiable(false);
  13. }
  14. void OnDestroy()
  15. {
  16. if (ins == this) ins = null;
  17. }
  18. public bool IsVisiable() {
  19. return gameObject.activeSelf;
  20. }
  21. public void SetVisiable(bool visiable) {
  22. gameObject.SetActive(visiable);
  23. if (visiable) {
  24. GetComponentInChildren<Text>().text =
  25. TextAutoLanguage2.GetTextByKey("home_loginAuth");
  26. }
  27. }
  28. public void SetText(string text) {
  29. GetComponentInChildren<Text>().text = text;
  30. }
  31. }