protected override void OnRequest(request_seven_state request, object userdata) { if (userdata is seven_stateparam) { seven_stateparam param = userdata as seven_stateparam; request.week = param.week; request.type = param.type; } }
void confirmRefresh(object para) { if (!cheak(int.Parse(CurGameObj.name))) { return; } seven_stateparam param = new seven_stateparam(); param.week = int.Parse(CurGameObj.name); param.type = 3; Net.Instance.DoAction((int)Message.MESSAGE_ID.ID_MSG_SEVEN_AWARD_STAGE, param); }
private void OnBtnClick(GameObject gameObj) { if (BigBagModle.MIN_DATA_NUM > int.Parse(gameObj.name) || BigBagModle.MAX_DATA_NUM < int.Parse(gameObj.name)) { return; } CurGameObj = gameObj; BigItemUnit big = null; foreach (var item in Pdm.mItemDic) { if (item.Key == int.Parse(gameObj.name)) { big = item.Value; break; } } if (null == big) { return; } BigBagModle.BUTTON_STATE state = 0; foreach (var item in Pdata.mStateData.mStateDic) { if (item.Key == int.Parse(gameObj.name)) { state = item.Value; break; } } switch (state) { case BigBagModle.BUTTON_STATE.Have_no: { big.mlabel.text = "领取"; UIAtlasHelper.SetButtonImage(big.mClickBtn, "common:btn_blue_4word"); int num = getWeek(); if (0 == num) { num = BigBagModle.MAX_DATA_NUM; } if (num != int.Parse(gameObj.name)) //不发送消息 { PopTipManager.Instance.AddNewTip(StringHelper.GetString("time_enough", FontColor.Red)); return; } seven_stateparam param = new seven_stateparam(); param.week = int.Parse(gameObj.name); param.type = 1; Net.Instance.DoAction((int)Message.MESSAGE_ID.ID_MSG_SEVEN_AWARD_STAGE, param); } break; case BigBagModle.BUTTON_STATE.Replenish_no: { big.mlabel.text = "补领"; UIAtlasHelper.SetButtonImage(big.mClickBtn, "common:btn_yellow_4word"); int num = getWeek(); if (0 == num) { num = BigBagModle.MAX_DATA_NUM; } if (num < int.Parse(gameObj.name)) //不发送消息 { return; } refreshBtnClick(); } break; case BigBagModle.BUTTON_STATE.Invalid: { GameDebug.Log("服务器错误"); } break; default: break; } }