private void OnClickBtnMines(GameObject sender) { if (this.currentUIState == ElementInstanceUI.ElementInstanceUIState.Ball) { this.currentUIState = ElementInstanceUI.ElementInstanceUIState.Mine; } else { this.currentUIState = ElementInstanceUI.ElementInstanceUIState.Ball; } if (this.currentUIState == ElementInstanceUI.ElementInstanceUIState.Mine) { ElementInstanceManager.Instance.SendMineInfoReq(delegate { if (ElementInstanceManager.Instance.m_mineInfoRes.mineInfos.get_Count() == 0) { this.TextNoMines.get_gameObject().SetActive(true); } else { this.TextNoMines.get_gameObject().SetActive(false); } this.ListViewMine.Refresh(); }); } this.SetUIState(this.currentUIState); }
private void SetUIState(ElementInstanceUI.ElementInstanceUIState state) { this.currentUIState = state; if (state == ElementInstanceUI.ElementInstanceUIState.Ball) { this.Ball.get_gameObject().SetActive(true); this.Mines.get_gameObject().SetActive(false); this.BtnMines.get_transform().FindChild("Image3").get_gameObject().SetActive(true); this.BtnMines.get_transform().FindChild("Image4").get_gameObject().SetActive(false); } else { this.Ball.get_gameObject().SetActive(false); this.Mines.get_gameObject().SetActive(true); this.BtnMines.get_transform().FindChild("Image3").get_gameObject().SetActive(false); this.BtnMines.get_transform().FindChild("Image4").get_gameObject().SetActive(true); } }