UIRealNameAuthenComponentSystem.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading.Tasks;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. using static System.Net.Mime.MediaTypeNames;
  7. namespace ET.Client
  8. {
  9. [FriendOf(typeof(UIRealNameAuthenComponent))]
  10. public static class UIRealNameAuthenComponentSystem
  11. {
  12. [ObjectSystem]
  13. public class UIRealNameAuthenComponentAwakeSystem : AwakeSystem<UIRealNameAuthenComponent>
  14. {
  15. protected override void Awake(UIRealNameAuthenComponent self, params object[] param)
  16. {
  17. ReferenceCollector rc = self.GetParent<UI>().GameObject.GetComponent<ReferenceCollector>();
  18. self.realNameObj = rc.Get<GameObject>("RealNameObj");
  19. self.unRealNameObj = rc.Get<GameObject>("unRealNameObj");
  20. self.yourName = rc.Get<GameObject>("yourName");
  21. self.yourAddress = rc.Get<GameObject>("yourAddress");
  22. self.nameInput = rc.Get<GameObject>("nameInput");
  23. self.addressInput = rc.Get<GameObject>("addressInput");
  24. self.sureBtn = rc.Get<GameObject>("sureBtn");
  25. self.sureBtn.GetComponent<Button>().onClick.AddListener(() => { self.OnSureBtn(); });
  26. self.Init();
  27. }
  28. }
  29. private static void Init(this UIRealNameAuthenComponent self)
  30. {
  31. self.unRealNameObj.SetActive(false);
  32. self.realNameObj.SetActive(true);
  33. }
  34. public static async void OnSureBtn(this UIRealNameAuthenComponent self)
  35. {
  36. await SoundManager.Instance.PlaySound("clickbtnsound");
  37. self.OnCloseAsync();
  38. }
  39. public static async void OnCloseAsync(this UIRealNameAuthenComponent self)
  40. {
  41. await UIHelper.Remove(self.ClientScene(),UIType.UIRealNameAuthen);
  42. }
  43. }
  44. }