void OnClick() { NoticeCellButton cellBtnObj = transform.gameObject.GetComponent <NoticeCellButton>(); if (cellBtnObj) { string url = NoticeModel.Instance.notices[cellBtnObj.noticeIndex].btn_url; link = url; OpenLinkButton.linkLabel = this; confirmFsm.SendEvent(confirmEvent); Debug.Log(link); } else { OpenLinkButton.linkLabel = this; confirmFsm.SendEvent(confirmEvent); Debug.Log(link); } }
// Use this for initialization void Start() { #if DIANXIN_ZIYOU || LIANTONG gameObject.SetActive(false); return; #endif GameObject noticeTableObj = GameObject.Find("NoticeTable"); for (int i = 0; i < noticeTableObj.transform.childCount; i++) { GameObject cellObj = noticeTableObj.transform.GetChild(i).gameObject; noticeCellObjects.Add(cellObj); GameObject buttonObj = cellObj.transform.Find("LinkButton").gameObject; buttonObjects.Add(buttonObj); NoticeCellButton cellBtnObj = buttonObj.GetComponent <NoticeCellButton>(); cellBtnObj.noticeIndex = i; } contentObj = GameObject.Find("MFP Notice Panel Portrait/NoticeDragPanel"); noContentObj = GameObject.Find("MFP Notice Panel Portrait/No net Label"); }