public void OnLoginClick(BaseEventData data) { print("login"); this.MoveOut(); maininterfacePanel.transform.GetComponent <MainInterface> ().FadeIn(); Hashtable table = new Hashtable(); table.Add("UserName", account.text); CustomEventData eventdata = new CustomEventData("AccountChange", table, this.gameObject); CustomEventManager.GetInstance().DispatchEvent(eventdata); }
void Awake() { GameObject nameBtn = transform.Find("Btn-UserName").gameObject; GameObject serverBtn = transform.Find("Btn-Server").gameObject; GameObject startBtn = transform.Find("Btn-Start").gameObject; EventTriggerManager.GetInstance().AddTriggerEvent(nameBtn, EventTriggerType.PointerClick, OnNameClick); EventTriggerManager.GetInstance().AddTriggerEvent(serverBtn, EventTriggerType.PointerClick, OnServerClick); EventTriggerManager.GetInstance().AddTriggerEvent(startBtn, EventTriggerType.PointerClick, OnStartClick); tweenAni = transform.GetComponent <DOTweenAnimation> (); username = nameBtn.transform.Find("Name").GetComponent <Text> (); CustomEventManager.GetInstance().AddEventListener("AccountChange", OnEventAccountChange); }
void OnDestory() { CustomEventManager.GetInstance().RemoveEventListener("AccountChange", OnEventAccountChange); }