123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System;
- using System.Collections.Generic;
- using System.Threading.Tasks;
- using UnityEngine;
- using UnityEngine.UI;
- using static System.Net.Mime.MediaTypeNames;
- namespace ET.Client
- {
- [FriendOf(typeof(UIIphoneComponent))]
- public static class UIIphoneComponentSystem
- {
- [ObjectSystem]
- public class UIIphoneComponentAwakeSystem : AwakeSystem<UIIphoneComponent>
- {
- protected override void Awake(UIIphoneComponent self, params object[] param)
- {
- ReferenceCollector rc = self.GetParent<UI>().GameObject.GetComponent<ReferenceCollector>();
- self.IphoneObj = rc.Get<GameObject>("IphoneObj");
- self.UnIphoneObj = rc.Get<GameObject>("UnIphoneObj");
- self.yourIphone = rc.Get<GameObject>("yourIphone");
- self.invateInput = rc.Get<GameObject>("invateInput");
- self.verCodeInput = rc.Get<GameObject>("verCodeInput");
- self.verCodeBtn = rc.Get<GameObject>("verCodeBtn");
- self.verCodeBtn.GetComponent<Button>().onClick.AddListener(() => { self.OnVerCodeBtn(); });
- self.sureBtn = rc.Get<GameObject>("sureBtn");
- self.sureBtn.GetComponent<Button>().onClick.AddListener(() => { self.OnSureBtn(); });
- self.Init();
- }
- }
- private static void Init(this UIIphoneComponent self)
- {
- self.UnIphoneObj.SetActive(false);
- self.IphoneObj.SetActive(true);
- }
- public static async void OnVerCodeBtn(this UIIphoneComponent self)
- {
- await SoundManager.Instance.PlaySound("clickbtnsound");
- }
- public static async void OnSureBtn(this UIIphoneComponent self)
- {
- await SoundManager.Instance.PlaySound("clickbtnsound");
- self.OnCloseAsync();
- }
- public static async void OnCloseAsync(this UIIphoneComponent self)
- {
- await UIHelper.Remove(self.ClientScene(),UIType.UIIphone);
- }
- }
- }
|