using Assets.Scripts; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class AddressController : PFUIPanel { // Start is called before the first frame update Dictionary inputDict; protected override void Awake() { inputDict = new Dictionary() { {"Name",transform.Find("Main/Name/input").GetComponent() }, {"Phone",transform.Find("Main/PN/input").GetComponent() }, {"Address",transform.Find("Main/Addr/input").GetComponent() }, }; inputDict["Name"].text = App.CurrentUser.Contact; inputDict["Phone"].text = App.CurrentUser.ContactPhone; inputDict["Address"].text = App.CurrentUser.ContactAddress; UIManager.AddEvent(transform.Find("Main/BtnJoin").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, async b => { App.CurrentUser.Contact = inputDict["Name"].text; App.CurrentUser.ContactPhone = inputDict["Phone"].text; App.CurrentUser.ContactAddress = inputDict["Address"].text; var res = await ConfigHelper.userApi.UpdateUserInfo(App.CurrentUser); if (res.result) { Close(); UIManager.ShowActivityPanel(App.ActivityUrl); } }); UIManager.AddEvent(transform.Find("Main/Exit").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b => { Close(); }); } void Start() { } // Update is called once per frame void Update() { } }