public void OnClose() { this.CloseFrame(); if (!m_data.m_click_act.IsNull) { m_data.m_click_act.SafeInvoke(); } SCSceneRewardResponse _msg = m_data.msg; WinFailData data = new WinFailData(ENUM_SEARCH_MODE.E_SEARCH_ROOM, _msg); FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(UIDefine.UI_WIN); param.Param = data; EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param); Dictionary <UBSParamKeyName, object> _param = new Dictionary <UBSParamKeyName, object>(); _param.Add(UBSParamKeyName.Success, _msg.SceneId > 0 ? 1 : 0); _param.Add(UBSParamKeyName.SceneID, SceneModule.Instance.SceneData.id); UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.game_finish, _msg.SceneId > 0 ? 1 : 0, _param); if (_msg.SceneId < 0) { //PushGiftManager.Instance.TurnOn(ENUM_PUSH_GIFT_BLOCK_TYPE.E_SEEK); } }
private void ShowFail(WinFailData data_) { EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.fail.ToString()); m_win.SetVisible(false); m_fail.Refresh(data_); m_fail.Visible = true; }
private void OnReconnectResponse() { //全部找到几秒后退出 if (CheckAllEntityFound()) { this.m_gameStatus = GameStatus.GAMEOVER; GameEvents.MainGameEvents.OnGameStatusChange.SafeInvoke(GameStatus.GAMEOVER); TimeModule.Instance.SetTimeout(() => { EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_GAME_MAIN); this.StopAndRemoveSceneBGM(false); SCSceneRewardResponse rsp = new SCSceneRewardResponse(); rsp.SceneId = -1; WinFailData data = new WinFailData(ENUM_SEARCH_MODE.E_SEARCH_ROOM, rsp); FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(UIDefine.UI_WIN); param.Param = data; EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param); //PushGiftManager.Instance.TurnOn(ENUM_PUSH_GIFT_BLOCK_TYPE.E_SEEK); }, 3f); Dictionary <UBSParamKeyName, object> _param = new Dictionary <UBSParamKeyName, object>(); _param.Add(UBSParamKeyName.Success, 0); _param.Add(UBSParamKeyName.SceneID, this.m_sceneId); UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.game_finish, null, _param); } }
public void Refresh(WinFailData data_) { m_mode = data_.m_mode; m_data = data_; RefreshLoseContent(); }
public override void OnShow(object param) { base.OnShow(param); if (null != param) { var ret = param as WinFailData; this.m_mode = ret.m_mode; m_data = ret; } m_close_btn.AddClickCallBack(OnCloseClicked); }
public override void OnScResponse(object s) { base.OnScResponse(s); if (s is SCCartoonRewardReqsponse) { var rsp = s as SCCartoonRewardReqsponse; this.CloseFrame(); WinFailData data = new WinFailData(ENUM_SEARCH_MODE.E_CARTOON, rsp); FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(UIDefine.UI_WIN); param.Param = data; EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param); //卡通不掉落物品 } }
public override void OnShow(object param) { base.OnShow(param); if (null != param) { var ret = param as WinFailData; this.m_mode = ret.m_mode; m_data = ret; } m_win_continue_btn.AddClickCallBack(ContinueClicked); //m_win_effect.Visible = true; m_lvl_up_reward_view.gameObject.transform.localPosition = Vector3.zero; m_lvl_up_reward_cg.alpha = 1.0f; m_cur_step = 0; UiStepTo(++m_cur_step); }
public void Refresh(WinFailData data_) { if (ENUM_SEARCH_MODE.E_SEARCH_ROOM == data_.m_mode) { SCSceneRewardResponse msg = data_.m_msg as SCSceneRewardResponse; long m_scene_group_id = FindObjSceneDataManager.ConvertSceneIdToSceneGroupId(msg.SceneId); var m_group_data = new FindObjSceneData(m_scene_group_id, 1, 0); var temp_data = FindObjSceneDataManager.Instance.GetDataBySceneGroupID(m_scene_group_id); if (null != temp_data) { m_group_data = temp_data; } long scene_difficult_id = FindObjSceneDataManager.GetSceneDifficultID(m_scene_group_id, m_group_data.m_lvl); ConfSceneDifficulty difficult_data = ConfSceneDifficulty.Get(scene_difficult_id); m_lvl_icon.Sprite = ConfPoliceRankIcon.Get(m_group_data.m_lvl).icon; m_lvl_name.Text = LocalizeModule.Instance.GetString(difficult_data.name); m_lvl_exp_slider.Value = (float)m_group_data.m_exp / (float)m_group_data.m_full_exp; m_lvl_exp_txt.Text = $"{m_group_data.m_exp}/{m_group_data.m_full_exp}"; } }
private void OnQuit(GameObject obj) { TimeModule.Instance.SetTimeout(() => { EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_GAME_MAIN); }, 0.1f); Visible = false; SCSceneRewardResponse msg = new SCSceneRewardResponse(); msg.SceneId = -1; WinFailData data = new WinFailData(ENUM_SEARCH_MODE.E_SEARCH_ROOM, msg); FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(UIDefine.UI_WIN); param.Param = data; EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param); Dictionary <UBSParamKeyName, object> _param = new Dictionary <UBSParamKeyName, object>(); _param.Add(UBSParamKeyName.Success, 0); _param.Add(UBSParamKeyName.SceneID, SceneModule.Instance.SceneData.id); UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.game_finish, null, _param); //PushGiftManager.Instance.TurnOn(ENUM_PUSH_GIFT_BLOCK_TYPE.E_SEEK); }
public void Refresh(WinFailData data_) { m_mode = data_.m_mode; m_data = data_; }
private void OnSCGameCurrencyResponse(object msgResponse) { Dictionary <UBSParamKeyName, object> _params = new Dictionary <UBSParamKeyName, object>() { { UBSParamKeyName.TotalTime, ((GameSceneBase)CurrentScene).GetElapseTime() }, { UBSParamKeyName.Error_Times, ((GameSceneBase)CurrentScene).TotalErrorTimes }, { UBSParamKeyName.Punish_Times, ((GameSceneBase)CurrentScene).GetPunishTime() }, }; UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.game_time, null, _params); SCSceneRewardResponse _msg = msgResponse as SCSceneRewardResponse; TimeModule.Instance.SetTimeout(() => { if (!MsgStatusCodeUtil.OnError(_msg.ResponseStatus)) { if (0 == _msg.UpLevelRewards.Count) { WinFailData data = new WinFailData(ENUM_SEARCH_MODE.E_SEARCH_ROOM, _msg); FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(UIDefine.UI_WIN); param.Param = data; EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param); Dictionary <UBSParamKeyName, object> _param = new Dictionary <UBSParamKeyName, object>(); _param.Add(UBSParamKeyName.Success, _msg.SceneId > 0 ? 1 : 0); _param.Add(UBSParamKeyName.SceneID, SceneModule.Instance.SceneData.id); UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.game_finish, _msg.SceneId > 0 ? 1 : 0, _param); if (_msg.SceneId < 0) { //PushGiftManager.Instance.TurnOn(ENUM_PUSH_GIFT_BLOCK_TYPE.E_SEEK); } } else { SceneLevelUpData data = new SceneLevelUpData() { msg = _msg, m_click_act = null, }; FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(UIDefine.UI_SCENE_LEVEL_UP); param.Param = data; EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param); } } else { SCSceneRewardResponse rsp = new SCSceneRewardResponse(); rsp.SceneId = -1; WinFailData data = new WinFailData(ENUM_SEARCH_MODE.E_SEARCH_ROOM, rsp); FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(UIDefine.UI_WIN); param.Param = data; EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param); Dictionary <UBSParamKeyName, object> _param = new Dictionary <UBSParamKeyName, object>(); _param.Add(UBSParamKeyName.Success, 0); _param.Add(UBSParamKeyName.Description, _msg.ResponseStatus.Code); _param.Add(UBSParamKeyName.SceneID, SceneModule.Instance.SceneData.id); UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.game_finish, null, _param); //PushGiftManager.Instance.TurnOn(ENUM_PUSH_GIFT_BLOCK_TYPE.E_SEEK); } }, 2.5f); }
public void RefreshOutPut(WinFailData data_) { int total_exp = 0, total_vit = 0, total_coin = 0, total_cash = 0; if (ENUM_SEARCH_MODE.E_JIGSAW == data_.m_mode) { var msg = data_.m_msg as SCFinishResponse; int cash = 0, coin = 0, exp = 0, vit = 0; foreach (var item in msg.Rewards) { switch (item.Type) { case (int)EUNM_BASE_REWARD.E_CASH: cash = item.Num; break; case (int)EUNM_BASE_REWARD.E_COIN: coin = item.Num; break; case (int)EUNM_BASE_REWARD.E_EXP: exp = item.Num; break; case (int)EUNM_BASE_REWARD.E_VIT: vit = item.Num; break; } } total_exp = exp; total_vit = vit; total_coin = coin; total_cash = cash; } else if (ENUM_SEARCH_MODE.E_CARTOON == data_.m_mode) { var msg = data_.m_msg as SCCartoonRewardReqsponse; total_exp = msg.Exp; total_vit = msg.Vit; total_coin = msg.Coin; total_cash = msg.Cash; } else if (ENUM_SEARCH_MODE.E_SEARCH_ROOM == data_.m_mode) { SCSceneRewardResponse msg = data_.m_msg as SCSceneRewardResponse; total_exp = msg.OutputExp; total_vit = msg.OutputVit; total_coin = msg.OutputCoin; total_cash = msg.OutputCash; } List <EUNM_BASE_REWARD> types = new List <EUNM_BASE_REWARD>(); List <int> counts = new List <int>(); m_output_item_dict = new Dictionary <EUNM_BASE_REWARD, DropItemIconShake>(); if (total_exp > 0) { types.Add(EUNM_BASE_REWARD.E_EXP); counts.Add(total_exp); } if (total_vit > 0) { types.Add(EUNM_BASE_REWARD.E_VIT); counts.Add(total_vit); } if (total_coin > 0) { types.Add(EUNM_BASE_REWARD.E_COIN); counts.Add(total_coin); } if (total_cash > 0) { types.Add(EUNM_BASE_REWARD.E_CASH); counts.Add(total_cash); } m_output_grid.EnsureSize <DropItemIconShake>(types.Count); for (int i = 0; i < m_output_grid.ChildCount; ++i) { var item = m_output_grid.GetChild <DropItemIconShake>(i); item.InitSprite(CommonHelper.GetOutputIconName(types[i]), counts[i]); item.Visible = false; item.Visible = true; m_output_item_dict.Add(types[i], item); } TweenOutputNum(total_exp, total_vit, total_coin, total_cash); }
public void Refresh(WinFailData data_) { RefreshOutPut(data_); RefreshDrop(data_); }
public void RefreshDrop(WinFailData data_) { List <OutPutData> datas = new List <OutPutData>(); if (ENUM_SEARCH_MODE.E_JIGSAW == data_.m_mode) { var msg = data_.m_msg as SCFinishResponse; ConfProp prop = ConfProp.Get(msg.PropId); if (null != prop) { OutPutData data = new OutPutData() { Icon = ConfProp.Get(msg.PropId).icon, Count = 0, ItemID = msg.PropId, }; datas.Add(data); } } else if (ENUM_SEARCH_MODE.E_SEARCH_ROOM == data_.m_mode) { SCSceneRewardResponse msg = data_.m_msg as SCSceneRewardResponse; foreach (var item in msg.GiftItems) { OutPutData data = new OutPutData() { Icon = ConfProp.Get(item.ItemId).icon, Count = item.Num, ItemID = item.ItemId, }; datas.Add(data); } //for (int i = 1; i < 4; ++i) //{ // OutPutData data = new OutPutData() // { // Icon = ConfProp.Get((long)i).icon, // Count = 1, // ItemID = (long)i, // }; // datas.Add(data); //} } m_drop_grid.EnsureSize <DropItemIcon>(datas.Count); for (int i = 0; i < m_drop_grid.ChildCount; ++i) { var item = m_drop_grid.GetChild <DropItemIcon>(i); item.InitSprite(datas[i].Icon, datas[i].Count, datas[i].ItemID); item.gameObject.transform.localScale = Vector3.zero; item.Visible = true; } if (datas.Count > 0) { m_move_index = 0; m_move_count = datas.Count - 1; m_drop_scroll.scrollView.horizontal = false; m_cur_x = m_from_x = m_drop_grid_ori_local_x - (m_drop_item_size_x + m_drop_item_space_x) * m_move_count; m_drop_grid.gameObject.transform.localPosition = new Vector3(m_from_x, m_drop_grid.gameObject.transform.localPosition.y, m_drop_grid.gameObject.transform.localPosition.z); DropItemMoveFinished(); //DropItemMove(); } }
public override void OnShow(object param) { base.OnShow(param); GameEvents.UIEvents.UI_Bonus_Pop_View_Event.Tell_OnBlock.SafeInvoke(true); GameEvents.UI_Guid_Event.OnSceneShowResult += OnSceneShowResult; EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_GAME_MAIN_SETTING); GameEvents.TaskEvents.OnBlockSyncTask.SafeInvoke(true); m_is_win = false; if (null != param) { var ret = param as WinFailData; this.m_mode = ret.m_mode; m_data = ret; m_add_exp = 0; if (ENUM_SEARCH_MODE.E_JIGSAW == this.m_mode) { var msg = ret.m_msg as SCFinishResponse; if (0 == msg.Result) { EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.jigsaw_done.ToString()); this.ShowWin(ret); if (0 != msg.PropId) { GlobalInfo.MY_PLAYER_INFO.AddSingleBagInfo(msg.PropId, 1); GameEvents.UIEvents.UI_GameEntry_Event.Listen_OnCombinePropCollected.SafeInvoke(); } } else { this.ShowFail(ret); } } else if (ENUM_SEARCH_MODE.E_CARTOON == this.m_mode) { var msg = ret.m_msg as SCCartoonRewardReqsponse; EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.sucess.ToString()); this.ShowWin(ret); } else if (ENUM_SEARCH_MODE.E_SEARCH_ROOM == this.m_mode) { InputModule.Instance.Enable = false; var msg = ret.m_msg as SCSceneRewardResponse; GameEvents.UI_Guid_Event.OnFindSceneResult.SafeInvoke(msg.SceneId > 0); if (msg.SceneId > 0) { EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.sucess.ToString()); this.ShowWin(ret); foreach (var item in msg.GiftItems) { GlobalInfo.MY_PLAYER_INFO.AddSingleBagInfo(item.ItemId, item.Num); } GameEvents.UIEvents.UI_GameEntry_Event.Listen_OnCombinePropCollected.SafeInvoke(); } else { this.ShowFail(ret); } } } }
public override void OnScResponse(object s) { base.OnScResponse(s); if (s is SCEventRewardResponse) { var rsp = s as SCEventRewardResponse; if (!MsgStatusCodeUtil.OnError(rsp.ResponseStatus)) { this.CloseFrame(); if (!MsgStatusCodeUtil.OnError(rsp.ResponseStatus)) { WinFailData data = new WinFailData(ENUM_SEARCH_MODE.E_EVENTGAME, rsp); FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(UIDefine.UI_WIN); param.Param = data; EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param); Dictionary <UBSParamKeyName, object> _params = new Dictionary <UBSParamKeyName, object>() { { UBSParamKeyName.ContentID, EventGameManager.Instance.Event_id }, { UBSParamKeyName.Success, rsp.Valuation }, }; UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.event_finish, null, _params); if (0 == rsp.Valuation) { //PushGiftManager.Instance.TurnOn(ENUM_PUSH_GIFT_BLOCK_TYPE.E_EVENT); } } else { rsp.Valuation = 0; rsp.Rewards.Clear(); WinFailData data = new WinFailData(ENUM_SEARCH_MODE.E_EVENTGAME, rsp); FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(UIDefine.UI_WIN); param.Param = data; EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param); Dictionary <UBSParamKeyName, object> _params = new Dictionary <UBSParamKeyName, object>() { { UBSParamKeyName.ContentID, EventGameManager.Instance.Event_id }, { UBSParamKeyName.Success, 0 }, { UBSParamKeyName.Description, rsp.ResponseStatus.Code } }; UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.event_finish, null, _params); //PushGiftManager.Instance.TurnOn(ENUM_PUSH_GIFT_BLOCK_TYPE.E_EVENT); } } } }
public void RefreshOutPut(WinFailData data_) { int total_exp = 0, total_vit = 0, total_coin = 0, total_cash = 0; if (ENUM_SEARCH_MODE.E_SEARCH_ROOM == data_.m_mode) { SCSceneRewardResponse msg = data_.m_msg as SCSceneRewardResponse; //20 体力 //21 金币 //22 钞票 //23 经验 foreach (var item in msg.UpLevelRewards) { if (20 == item.ItemId) { total_vit += item.Num; } else if (21 == item.ItemId) { total_coin += item.Num; } else if (22 == item.ItemId) { total_cash += item.Num; } else if (23 == item.ItemId) { total_exp += item.Num; } } List <EUNM_BASE_REWARD> types = new List <EUNM_BASE_REWARD>(); List <int> counts = new List <int>(); m_output_item_dict = new Dictionary <EUNM_BASE_REWARD, DropItemIcon>(); if (total_exp > 0) { types.Add(EUNM_BASE_REWARD.E_EXP); counts.Add(total_exp); } if (total_vit > 0) { types.Add(EUNM_BASE_REWARD.E_VIT); counts.Add(total_vit); } if (total_coin > 0) { types.Add(EUNM_BASE_REWARD.E_COIN); counts.Add(total_coin); } if (total_cash > 0) { types.Add(EUNM_BASE_REWARD.E_CASH); counts.Add(total_cash); } m_output_grid.EnsureSize <DropItemIcon>(types.Count); for (int i = 0; i < m_output_grid.ChildCount; ++i) { var item = m_output_grid.GetChild <DropItemIcon>(i); item.InitSprite(CommonHelper.GetOutputIconName(types[i]), counts[i]); item.Visible = false; item.Visible = true; m_output_item_dict.Add(types[i], item); } TweenOutputNum(total_exp, total_vit, total_coin, total_cash); } }