// Use this for initializationitemid void Start() { if (GamePlayer.Instance.babies_list_.Count == 0) { ClearText(0); } UIManager.SetButtonEventHandler(daimingBtn.gameObject, EnumButtonEvent.OnClick, OnClickDM, 0, 0); UIManager.SetButtonEventHandler(chuzhanBtn.gameObject, EnumButtonEvent.OnClick, OnClickCZ, 0, 0); GlobalValue.Get(Constant.C_BabyExpItem, out itemid); UIManager.SetButtonEventHandler(babyBank.gameObject, EnumButtonEvent.OnClick, OnClickbabyBank, 0, 0); UIManager.SetButtonEventHandler(babyDel.gameObject, EnumButtonEvent.OnClick, OnClickbabyDel, 0, 0); UIManager.SetButtonEventHandler(kjBtn.gameObject, EnumButtonEvent.OnClick, OnClickbabykjBtn, 0, 0); //UIManager.SetButtonEventHandler (babyHuiS.gameObject, EnumButtonEvent.OnClick, OnClickbabyHuiS,0, 0); UIManager.SetButtonEventHandler(changeNameBtn.gameObject, EnumButtonEvent.OnClick, OnClickchangeName, 0, 0); UIManager.SetButtonEventHandler(zhanshiBtn.gameObject, EnumButtonEvent.OnClick, OnClickzhanshiBtn, 0, 0); UIManager.SetButtonEventHandler(suodingBtn.gameObject, EnumButtonEvent.OnClick, OnClicksuodingBtn, 0, 0); UIManager.SetButtonEventHandler(shouhuiBtn.gameObject, EnumButtonEvent.OnClick, OnClickshouhuiBtn, 0, 0); UIManager.SetButtonEventHandler(jiesuoBtn.gameObject, EnumButtonEvent.OnClick, OnClickjiesuoBtn, 0, 0); ShowBabyNewName = ChangeBabyName; SetKJBtnstateEventOk = SetKJBtnstate; babyInfo = BabyInfoShow; MainbabyListUI.RefreshBabyListOk += ClearText; shouhuiBtn.gameObject.SetActive(binst.isShow_); zhanshiBtn.gameObject.SetActive(!binst.isShow_); if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { kjBtn.gameObject.SetActive(false); chuzhanBtn.gameObject.SetActive(false); daimingBtn.gameObject.SetActive(false); babyBank.gameObject.SetActive(false); babyDel.gameObject.SetActive(false); zhanshiBtn.gameObject.SetActive(false); shouhuiBtn.gameObject.SetActive(false); changeNameBtn.gameObject.SetActive(false); suodingBtn.gameObject.SetActive(false); jiesuoBtn.gameObject.SetActive(false); } }
void OnEnable() { babyInfo = BabyInfoShow; ResBabyInfoOk = UpDateBabyInfo; GamePlayer.Instance.babyUpdateIpropEvent += UpDateBabyInfo; if (MainbabyProperty.idss != null) { UpDateBabyInfo(MainbabyProperty.idss[0]); } if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { kjBtn.gameObject.SetActive(false); chuzhanBtn.gameObject.SetActive(false); daimingBtn.gameObject.SetActive(false); babyBank.gameObject.SetActive(false); babyDel.gameObject.SetActive(false); zhanshiBtn.gameObject.SetActive(false); shouhuiBtn.gameObject.SetActive(false); changeNameBtn.gameObject.SetActive(false); suodingBtn.gameObject.SetActive(false); jiesuoBtn.gameObject.SetActive(false); } }
void OnDisable() { babyInfo = null; ResBabyInfoOk = null; GamePlayer.Instance.babyUpdateIpropEvent -= UpDateBabyInfo; }