/// <summary> /// 获取仓库信息 /// </summary> /// <param name="call"></param> public void SendGetWareInfo(CallBack call) { CommonSendProto req = new CommonSendProto(); NetProcess.SendRequest <CommonSendProto>(req, ProtoIdMap.CMD_SendGetWareInfo, (msg) => { SendGetWareInfoAck ack = msg.Read <SendGetWareInfoAck>(); if (ack.code == 1) { PlayerModel.Inst.UserInfo.gold = ack.data.info.gold; PlayerModel.Inst.UserInfo.wareHouse = ack.data.info.ware; PlayerModel.Inst.UserInfo.roomCard = ack.data.info.roomCard; GlobalEvent.dispatch(eEvent.UPDATE_PROP); if (call != null) { call(); } } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 借珍珠 /// </summary> /// <param name="gold"></param> /// <param name="uid"></param> public void SendBorrowGold(int gold, string uid, CallBack <float> call) { SendBorrowReturnGold req = new SendBorrowReturnGold(); req.glod = gold; req.uid = uid; NetProcess.SendRequest <SendBorrowReturnGold>(req, ProtoIdMap.CMD_SendBorrowGold, (msg) => { SendBorrowReturnGoldAck ack = msg.Read <SendBorrowReturnGoldAck>(); if (ack.code == 1) { //Global.Inst.GetController<CommonTipsController>().ShowTips("打赏成功!"); PlayerModel.Inst.UserInfo.gold -= gold; GlobalEvent.dispatch(eEvent.UPDATE_PROP); if (call != null) { call(ack.data.ware); //} //if (mView!=null) { // mView.UpdateByNet(); } } else { GameUtils.ShowErrorTips(ack.code); } }); }
public void OnGetBtn_Click() { mWin.SetActive(false); if (reward.type.Equals("gold")) { PlayerModel.Inst.UserInfo.gold += reward.num; GlobalEvent.dispatch(eEvent.UPDATE_PROP, reward.num); } }
public string OpenInstallArgs;//扫二维码数据 /// <summary> /// 更新房卡和金币 /// </summary> /// <param name="roomCard"></param> /// <param name="glods"></param> public void UpdateRoomCardGlods(float roomCard, float glods) { if (roomCard != -1) { UserInfo.roomCard = roomCard; } if (glods != -1) { UserInfo.gold = glods; } GlobalEvent.dispatch(eEvent.UPDATE_PROP); }