void SetButton(SignInButtonInfo buttonInfo, bool enable) { if (buttonInfo == null || buttonInfo.m_Button == null) { return; } buttonInfo.m_Button.isEnabled = enable; UIButtonColor.State state = enable ? UIButtonColor.State.Normal : UIButtonColor.State.Disabled; string spriteName = GetSpriteName(state); buttonInfo.m_BG[0].spriteName = spriteName; buttonInfo.m_BG[1].spriteName = spriteName; }
// HallLoginUI_Activity m_Parent; public void Init(GameObject go) { m_BaseWndObject = go; m_BaseTrans = m_BaseWndObject.transform; for (byte i = 0; i < m_SignInChestsInfo.Length; ++i) { m_SignInChestsInfo[i].m_SignInChestsBtn = m_BaseTrans.GetChild(i).GetComponent <UIButton>(); m_SignInChestsInfo[i].m_GetFlagObj = m_BaseTrans.GetChild(i).GetChild(1).gameObject; m_SignInChestsInfo[i].m_SignInLevel = m_BaseTrans.GetChild(i).GetChild(0).GetComponent <UILabel>(); UIEventListener.Get(m_SignInChestsInfo[i].m_SignInChestsBtn.gameObject).onClick = OnClickChestsReward; } for (byte i = 0; i < m_SignInBtns.Length; ++i) { m_SignInBtns[i] = new SignInButtonInfo(); Transform tran = m_BaseTrans.GetChild(8 + i); m_SignInBtns[i].m_Button = tran.GetComponent <UIButton>(); m_SignInBtns[i].m_Obj = tran.gameObject; m_SignInBtns[i].m_DayTime = m_BaseTrans.GetChild(6 + i).GetComponent <UILabel>(); m_SignInBtns[i].m_BG[0] = tran.GetChild(1).GetComponent <UISprite>(); m_SignInBtns[i].m_BG[1] = m_SignInBtns[i].m_BG[0].transform.GetChild(0).GetComponent <UISprite>(); m_SignInBtns[i].m_CanSign = tran.GetChild(0).gameObject; m_SignInBtns[i].m_AlreadySign = tran.GetChild(2).gameObject; if (i == 0) { UIEventListener.Get(m_SignInBtns[i].m_Obj).onClick = OnClickRepeatSignIn; UIEventListener.Get(m_SignInBtns[i].m_Obj).onPress = OnPressRepeatSignIn; UIEventListener.Get(m_SignInBtns[i].m_Obj).onHover = OnPressRepeatSignIn; } else { UIEventListener.Get(m_SignInBtns[i].m_Obj).onClick = OnClickSignIn; UIEventListener.Get(m_SignInBtns[i].m_Obj).onPress = OnPressSignIn; UIEventListener.Get(m_SignInBtns[i].m_Obj).onHover = OnPressSignIn; } } m_RetroactivePrice = m_BaseTrans.GetChild(8).GetChild(0).GetComponent <UILabel>(); m_ScrollTrans = m_BaseTrans.GetChild(5).GetChild(0); m_UIPanel = m_BaseTrans.GetChild(5).GetChild(0).GetComponent <UIPanel>(); m_BasePropItem = m_BaseTrans.GetChild(5).GetChild(0).GetChild(0).gameObject; for (byte i = 0; i < m_UIGrid.Length; ++i) { m_UIGrid[i] = m_BaseTrans.GetChild(5).GetChild(0).GetChild(1 + i).GetComponent <UIGrid>(); } }