public static ClickEventListener Get(GameObject obj) { ClickEventListener listener = obj.GetComponent <ClickEventListener>(); if (listener == null) { listener = obj.AddComponent <ClickEventListener>(); } return(listener); }
public override void InitWndOnAwake() { base.InitWndOnAwake(); if (BtnClose != null) { ClickEventListener.Get(BtnClose).SetClickEventHandler(OnCloseClick); } if (BtnCancel != null) { ClickEventListener.Get(BtnCancel).SetClickEventHandler(OnCancelClick); } if (BtnOK != null) { ClickEventListener.Get(BtnOK).SetClickEventHandler(OnOKClick); } }