public override void OnShow(object param) { base.OnShow(param); long scan_id = 0; if (null != param) { List <long> my_param = param as List <long>; scan_id = my_param[0]; } ConfFind scan_data = ConfFind.Get(scan_id); m_time_txt.Text = CommonTools.SecondToStringMMSS((double)scan_data.time); m_desc_txt.Text = LocalizeModule.Instance.GetString(scan_data.descs); Dictionary <int, HashSet <long> > scan_datas = ScanDataManager.Instance.Examin_clue_datas(scan_id); m_examine_grid.EnsureSize <ExamineItemView>(scan_datas.Keys.Count); int i = 0; foreach (var kvp in scan_datas) { int scan_type = kvp.Key; var item = m_examine_grid.GetChild <ExamineItemView>(i); item.Refresh(ConfFindTypeIcon.Get(scan_type).icon, $"{ConfFindTypeIcon.Get(scan_type).name} {kvp.Value.Count}"); item.Visible = true; ++i; } }
public void UpdateTime(double senconds_) { m_time_txt.Text = CommonTools.SecondToStringMMSS(senconds_); }
public override void OnShow(object param) { base.OnShow(param); GameEvents.UIEvents.UI_GameEntry_Event.OnMaskBGVisible.SafeInvoke(true); GameEvents.UIEvents.UI_GameEntry_Event.OnInfiniteVit += OnInfiniteVit; MessageHandler.RegisterMessageHandler(MessageDefine.SCSceneEnterResponse, OnScResponse); this.m_action_btn.AddClickCallBack(OnBtnStartGameClick); this.m_exp_reward_icon.AddPressDownCallBack(OnSceneGroupGiftPressDown); this.m_exp_reward_icon.AddPressUpCallBack(OnSceneGroupGiftPressUp); EnterSceneData enterSceneData = null; m_scene_id = -1; m_scene_group_id = -1; m_enter_msg = null; if (null != param) { enterSceneData = param as EnterSceneData; //this.m_scene_id = (int)enterSceneData.SceneID; this.m_taskConfID = enterSceneData.taskConfID; } if (-1 == m_taskConfID) { //不是从任务展示界面来的,不用翻转 BgShowAlpha(false); PanelDelayShowAlpha(0.0f); PanelDelayShowScale(0.0f); PanelTurnToOne(false); PanelGoDown(true); } else { //需要翻转 BgShowAlpha(true); PanelDelayShowAlpha(0.2f); PanelDelayShowScale(0.5f); PanelGoDown(false); PanelTurnToZero(false); PanelTurnToOne(true); } ConfTask task = null; if (this.m_taskConfID < 0) { //build top 进入 this.m_scene_group_id = FindObjSceneDataManager.ConvertSceneIdToSceneGroupId(enterSceneData.SceneID); m_group_data = new FindObjSceneData(this.m_scene_group_id, 1, 0); BuildTopCreateSceneByDifficult(this.m_scene_group_id); } else { task = ConfTask.Get(m_taskConfID); long tsk_scene_id = null != task ? task.conditionSceneId : enterSceneData.SceneID; m_special_scene_id = 0; //初始化一个默认的group data; m_group_data = new FindObjSceneData(FindObjSceneDataManager.ConvertSceneIdToSceneGroupId(tsk_scene_id), 1, 0); this.m_scene_group_id = FindObjSceneDataManager.ConvertSceneIdToSceneGroupId(tsk_scene_id); var temp_data = FindObjSceneDataManager.Instance.GetDataBySceneGroupID(m_scene_group_id); if (null != temp_data) { m_group_data = temp_data; } if (tsk_scene_id > 99999) { //配置的场景id if (1 == ConfScene.Get(tsk_scene_id).keyExhibit) { //关键证据关卡 CreateSceneBySpecial(tsk_scene_id); } else { //非关键关卡 //读取难度表 TaskCreateSceneByDifficult(this.m_taskConfID); } } else { //配置的场景组id,一定是非关键线索关卡 TaskCreateSceneByDifficult(this.m_taskConfID); } } m_play_mode_img.Sprite = this.GetModeIconName(m_scene_id); m_scene_tex.TextureName = m_s_info.thumbnail; m_scene_name_label.Text = LocalizeModule.Instance.GetString(m_s_info.name); this.ShowOutPut(m_s_info.outputExp, m_s_info.outputMoney, m_s_info.outputCash, m_s_info.outputVit); List <long> ids = CommonHelper.GetDropOuts(m_s_info.dropId); var props = from id in ids select new DropWrapper() { DropType = ENUM_DROP_TYPE.PROP, ItemID = id, ItemNum = 0, Icon = ConfProp.Get(id).icon, }; List <DropWrapper> totalToShow = new List <DropWrapper>(); if (null != task && task.conditionExhibits.Length > 0) { var exhibits = from id in task.conditionExhibits select new DropWrapper() { DropType = ENUM_DROP_TYPE.EXHABIT, ItemID = id, ItemNum = 0, Icon = Confexhibit.Get(id).iconName, }; totalToShow.AddRange(exhibits); } //DropWrapper te = new DropWrapper() //{ // DropType = ENUM_DROP_TYPE.EXHABIT, // ItemID = 10972, // ItemNum = 0, // Icon = Confexhibit.Get(10972).iconName, //}; //totalToShow.Add(te); totalToShow.AddRange(props); m_drop_grid.EnsureSize <DropItemIconEffect>(totalToShow.Count); for (int i = 0; i < m_drop_grid.ChildCount; ++i) { var show = totalToShow[i]; DropItemIconEffect di = m_drop_grid.GetChild <DropItemIconEffect>(i); m_drop_grid.GetChild <DropItemIconEffect>(i).InitSprite(show.Icon, show.ItemNum, show.ItemID, ENUM_DROP_TYPE.EXHABIT == show.DropType); if (ENUM_DROP_TYPE.PROP == show.DropType) { m_drop_grid.GetChild <DropItemIconEffect>(i).EnableTips(true); m_drop_grid.GetChild <DropItemIconEffect>(i).InitToolTipOffset(new Vector2(-280.0f, 0.0f)); } else { m_drop_grid.GetChild <DropItemIconEffect>(i).EnableTips(false); } m_drop_grid.GetChild <DropItemIconEffect>(i).Visible = true; } m_drop_grid.Visible = false; long scene_difficult_id = FindObjSceneDataManager.GetSceneDifficultID(m_scene_group_id, m_group_data.m_lvl); ConfSceneDifficulty difficult_data = ConfSceneDifficulty.Get(scene_difficult_id); m_gifts = new List <GroupToolTipsData>(); for (int i = 0; i < difficult_data.rewards.Length; ++i) { GroupToolTipsData reward = new GroupToolTipsData() { ItemID = difficult_data.rewards[i], CurCount = difficult_data.rewardNums[i], }; m_gifts.Add(reward); } m_difficult_icon.Sprite = ConfPoliceRankIcon.Get(m_group_data.m_lvl).icon; m_difficlut_step.Text = LocalizeModule.Instance.GetString(difficult_data.name); m_exp_progress.Value = (float)m_group_data.m_exp / (float)m_group_data.m_full_exp; m_exp_txt.Text = $"{m_group_data.m_exp}/{m_group_data.m_full_exp}"; Debug.Log($"关卡进入 关卡组id{m_group_data.m_scene_group_id}"); m_cost_time_num_label.Text = CommonTools.SecondToStringMMSS(this.m_time_cost_value); SetVitLabel(); m_is_action_btn_touched = false; this.m_action_btn.Enable = true; Dictionary <UBSParamKeyName, object> _params = new Dictionary <UBSParamKeyName, object>() { { UBSParamKeyName.Success, 1 }, { UBSParamKeyName.SceneID, this.m_scene_id }, }; UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.game_start, null, _params); }
public void Refresh(long scene_id_, long task_id_ = -1) { m_task_id = task_id_; ConfJigsawScene data = ConfJigsawScene.Get(scene_id_); m_desc_txt.Text = LocalizeModule.Instance.GetString(data.desc2); m_output_title_txt.Text = LocalizeModule.Instance.GetString("ui.event.Output"); m_time_txt.Text = CommonTools.SecondToStringMMSS(data.percent4); m_thumbnail_tex.TextureName = data.thumbnail; RefreshOutputData(data); RefreshOutputView(); //m_drop_title_txt.Text = LocalizeModule.Instance.GetString("ui.event.CommonDrop"); //if (data.propId > 0) //{ // List<long> ids = CommonHelper.GetDropOuts(data.propId); // m_drop_grid.EnsureSize<DropItemIcon>(ids.Count); // for (int i = 0; i < m_drop_grid.ChildCount; ++i) // { // m_drop_grid.GetChild<DropItemIcon>(i).InitSprite(ConfProp.Get(ids[i]).icon, 0, ids[i]); // m_drop_grid.GetChild<DropItemIcon>(i).Visible = true; // } //} //else //{ // m_drop_grid.Clear(); //} m_case_name_txt.Text = LocalizeModule.Instance.GetString(data.name); if (data.costPropIds.Length > 0) { long prop_id = data.costPropIds[0]; m_ticket_icon.Sprite = ConfProp.Get(prop_id).icon; m_item_in_bag_num = null != GlobalInfo.MY_PLAYER_INFO.GetBagInfosByID(prop_id) ? GlobalInfo.MY_PLAYER_INFO.GetBagInfosByID(prop_id).Count : 0; m_item_cost_num = data.costPropNums[0]; m_action_btn_num_txt.Text = string.Format("{0}/{1}", m_item_in_bag_num, m_item_cost_num); if (m_item_in_bag_num >= m_item_cost_num) { m_action_btn_num_txt.color = Color.white; } else { m_action_btn_num_txt.color = Color.red; } } else { m_action_btn_num_txt.Text = ""; } }