public void SendBlessingMsg(BlessResult bless) { Debug.Log(_curVisitVo.NpcId + " " + _curVisitVo.CurWeatherName); Debug.Log(bless); if (GlobalData.PlayerModel.PlayerVo.Gem < _curVisitVo.BlessCost) { FlowText.ShowMessage(I18NManager.Get("Shop_NotEnoughGem")); WeatherView.FailedBless(); return; } if (_curVisitVo.CurWeather == VISIT_WEATHER.Fine) { return; } BlessReq req = new BlessReq { Player = _curVisitVo.NpcId, Level = (int)bless }; var dataBytes = NetWorkManager.GetByteData(req); NetWorkManager.Instance.Send <BlessRes>(CMD.VISITINGC_BLESS, dataBytes, OnVisitingBlessHandler, OnVisitingBlessHandlerError); }
private void Blessing(BlessResult result) { if (_curVisitVo.CurWeather == VISIT_WEATHER.Fine) { _isSendBless = false; return; } _isCanClickResult = false; // SetButtonHide(); _blessing.gameObject.Hide(); Debug.Log("Blessing"); _result.gameObject.Show(); _preBless = _curVisitVo.CurWeather; SendMessage(new Message(MessageConst.CMD_VISIT_WEATHER_BLESSING_CLICK, Message.MessageReciverType.CONTROLLER, result)); }
public override void OnMessage(Message message) { string name = message.Name; object[] body = message.Params; switch (name) { case MessageConst.CMD_VISIT_WEATHER_JUMP_CLICK: Debug.Log("CMD_VISIT_WEATHER_JUMP_CLICK"); if (_curVisitVo.CurWeather == VISIT_WEATHER.Fine) { SendMessage(new Message(MessageConst.MODULE_VISIT_SHOW_LEVEL_PANEL, Message.MessageReciverType.DEFAULT, _curVisitVo.NpcId)); } else { PopupManager.ShowConfirmWindow(I18NManager.Get("Visit_Weather_Tips"), I18NManager.Get("Common_OK2")).WindowActionCallback = evt => { if (evt == WindowEvent.Ok) { SendMessage(new Message(MessageConst.MODULE_VISIT_SHOW_LEVEL_PANEL, Message.MessageReciverType.DEFAULT, _curVisitVo.NpcId)); } }; } break; case MessageConst.CMD_VISIT_WEATHER_BLESSING_CLICK: Debug.Log("CMD_VISIT_WEATHER_BLESSING_CLICK"); BlessResult result = (BlessResult)body[0]; SendBlessingMsg(result); break; case MessageConst.CMD_VISIT_WEATHER_RESULT_CLICK: OnClickResultMask(); break; } }