public void RefreshRewardItem() { ConfProp confProp = ConfProp.Get(this.m_rewardItemData.ItemID); if (confProp == null) { Debug.LogError($"item {this.m_rewardItemData.ItemID} not found"); } this.m_itemIcon.Sprite = confProp.icon; this.m_itemName.Text = LocalizeModule.Instance.GetString(confProp.name); this.m_itemNum.Text = $"x{m_rewardItemData.ItemNum}"; }
//public void SetIconName(string iconName) //{ // this.m_IconImg.Sprite = iconName; //} public void SetData(long itemId, int count) { this.m_item_id = itemId; this.Num = count; ConfProp confprop = ConfProp.Get(itemId); if (confprop == null) { Debug.LogError("error prop id:" + itemId); return; } this.m_IconImg.Sprite = confprop.icon; }
public void SetData(DropInfo info) { ConfProp prop = ConfProp.Get(info.PropId); if (prop == null) { Visible = false; Debug.LogErrorFormat("no exist prop : " + info.PropId); } m_Icon.Sprite = prop.icon; m_Number.Text = string.Format("x{0}", info.Count); m_Name.Text = LocalizeModule.Instance.GetString(prop.name); }
private void InitSlots(LottoResponse res) { m_luckValue_lab.Text = res.Lucky.ToString(); m_cost_type = res.CostType; if (res.CostType == CostType.CostCoin) { m_moneyIcon_img.Sprite = "icon_mainpanel_coin_2.png"; SetBuyContent(res.CostValue, GlobalInfo.MY_PLAYER_INFO.Coin); } else if (res.CostType == CostType.CostCash) { m_moneyIcon_img.Sprite = "icon_mainpanel_cash_2.png"; SetBuyContent(res.CostValue, GlobalInfo.MY_PLAYER_INFO.Cash); } if (res.Items.Count != ITEMMAXSIZE) { Debug.Log("item 太少了"); } for (int i = 0; i < ITEMMAXSIZE; i++) { if (res.Items.Count > i) { LottoItemProto lottoItem = res.Items[i]; if (lottoItem == null) { continue; } ConfProp prop = ConfProp.Get(lottoItem.PropId); if (prop == null) { continue; } m_itemIcon_img[i].Sprite = prop.icon; //m_itemName_lab[i].Text = LocalizeModule.Instance.GetString(prop.name); m_itemCount_lab[i].Text = string.Format("x{0}", lottoItem.Count); m_special_root[i].Visible = lottoItem.Special; if (lottoItem.Special) { m_itemBg_img[i].Sprite = m_SpecialBG_Str; m_SpecialEffect.gameObject.transform.SetParent(m_itemBg_img[i].gameObject.transform, false); m_SpecialEffect.Visible = true; } else { m_itemBg_img[i].Sprite = m_NormalBG_Str; } } } }
private void AddProp(SCSceneRewardResponse msg) { foreach (var reward in msg.UpLevelRewards) { ConfProp prop = ConfProp.Get(reward.ItemId); if ((int)PROP_TYPE.E_FUNC == prop.type || (int)PROP_TYPE.E_CHIP == prop.type || (int)PROP_TYPE.E_NROMAL == prop.type || (int)PROP_TYPE.E_ENERGE == prop.type) { GlobalInfo.MY_PLAYER_INFO.AddSingleBagInfo(reward.ItemId, reward.Num); } } GameEvents.UIEvents.UI_GameEntry_Event.Listen_OnCombinePropCollected.SafeInvoke(); }
public void Refresh(IEnumerable <CombineGiftData> datas) { int i = 0; foreach (CombineGiftData data in datas) { if (i >= m_gifts.Length) { break; } m_gifts[i].Refresh(ConfProp.Get(data.m_id).icon, data.m_num); ++i; } }
public static List <PropData> getPropData(Dictionary <long, PlayerPropMsg> propMsg) { if (propMsg == null || 0 == propMsg.Count) { return(new List <PropData>()); } List <PlayerPropMsg> datas = new List <PlayerPropMsg>(propMsg.Values); List <PropData> propList = new List <PropData>(); for (int i = 0; i < datas.Count; i++) { PlayerPropMsg pd = datas[i]; ConfProp prop = ConfProp.Get(pd.PropId); if (prop == null) { continue; } if ((int)PROP_TYPE.E_EXHABIT == prop.type) //陈列物件除外 { continue; } if (prop.heapSize > 0 && prop.heapSize < pd.Count) { int cellNum = pd.Count / prop.heapSize; int finalPropNum = pd.Count % prop.heapSize; for (int j = 0; j < cellNum; j++) { PropData realPropData = new PropData(prop, prop.heapSize); propList.Add(realPropData); } if (finalPropNum != 0) { PropData realPropData = new PropData(prop, finalPropNum); propList.Add(realPropData); } } else { PropData realPropData = new PropData(prop, pd.Count); propList.Add(realPropData); } } return(propList); }
public void ShowGift(long combine_id_) { long gift_id = ConfCombineFormula.Get(combine_id_).dropGroupId; long drop_id = ConfProp.Get(gift_id).dropout; List <DropOutJsonData> datas = CommonHelper.GetFixedDropOuts(drop_id); var props = from data in datas select new CombineGiftData() { m_id = data.value, m_num = data.count }; m_gift_view.Visible = true; m_gift_view.Refresh(props); }
public void Refresh(long item_id_, int cur_count_, int max_count_) { ConfProp tool = ConfProp.Get(item_id_); m_tool_name.Text = LocalizeModule.Instance.GetString(tool.name); m_icon.Sprite = tool.icon; if (0 != max_count_) { m_num.Text = string.Format("{0} / {1}", cur_count_, max_count_); } else if (0 != cur_count_) { m_num.Text = cur_count_.ToString(); } else { m_num.Text = ""; } m_num.color = cur_count_ < max_count_ ? Color.red : Color.white; m_descs.Text = LocalizeModule.Instance.GetString(tool.description); List <string> adr_list = new List <string>(); string[] adr_array = tool.address; foreach (var adr in adr_array) { if (string.IsNullOrEmpty(adr)) { continue; } adr_list.Add(adr); } m_address_grid.EnsureSize <AddressItemView>(adr_list.Count); for (int i = 0; i < adr_list.Count; ++i) { m_address_grid.GetChild <AddressItemView>(i).Refresh(LocalizeModule.Instance.GetString(adr_list[i])); } m_bg.Widget.sizeDelta = new Vector2(m_bg.Widget.sizeDelta.x, C_BG_EXCEPT_GRID_H + adr_list.Count * C_ADDRESS_ITEM_H); }
private void OnSkillReset(long carryId) { ConfProp confprop = ConfProp.Get(carryId); if (confprop == null) { return; } ConfSkill releaseSkill = ConfSkill.Get(confprop.skillId); if (releaseSkill == null) { return; } if (carryId == this.m_propId) { if (GuidNewNodeManager.Instance.GetCommonParams(GuidNewNodeManager.PropFree) == this.m_propId.ToString()) { this.m_isCD = false; return; } PlayerPropMsg propMsg = GlobalInfo.MY_PLAYER_INFO.GetBagInfosByID(this.m_propId); if (propMsg != null) { //this.m_canClick = true; //this.m_btnItem.Enable = true; this.m_imgItem.SetGray(false); } else { //this.CanClick = false; this.m_lbRemain.Text = "+"; this.m_imgItem.SetGray(true); //this.m_btnItem.Enable = false; } this.m_isCD = false; } else if (IsFunctionProp(releaseSkill)) { if (IsFunctionProp(this.m_confSKill) || this.m_lbRemain.Text.Equals("+")) { this.m_isCD = false; } } }
public void SetData(long id, GameMainArrowTipData arrowData) { if (arrowData != null) { this.m_isArrowTips = (arrowData.propId == id); } this.m_propId = id; ConfProp confProp = ConfProp.Get(id); if (confProp == null) { Visible = false; } this.m_skillId = confProp.skillId; this.m_confSKill = ConfSkill.Get(this.m_skillId); this.m_imgItem.Sprite = confProp.icon; PlayerPropMsg propMsg = GlobalInfo.MY_PLAYER_INFO.GetBagInfosByID(id); this.m_keepPropNum = propMsg == null ? 0 : propMsg.Count; if (GuidNewNodeManager.Instance.GetCommonParams(GuidNewNodeManager.PropFree).Equals(this.m_propId.ToString())) { this.m_lbRemain.Text = "free"; return; } if (propMsg == null || propMsg.Count <= 0) { this.m_lbRemain.Text = "+"; this.m_imgItem.SetGray(true); //this.CanClick = false; //this.m_btnItem.Enable = false; } else { this.m_lbRemain.Text = propMsg.Count.ToString(); this.m_propId = id; //this.CanClick = true; //this.m_btnItem.Enable = true; this.m_imgItem.SetGray(false); } //ReflashBtnEnable(); }
void GetIconAndName(long ItemID, out string icon, out string itemName, out int item_type) { icon = string.Empty; itemName = string.Empty; item_type = 0; if (ItemID >= 9999) { Confexhibit exhibitConfig = Confexhibit.Get(ItemID); icon = exhibitConfig.iconName; itemName = LocalizeModule.Instance.GetString(exhibitConfig.name); item_type = 1; } else { ConfProp itemConfig = ConfProp.Get(ItemID); icon = itemConfig.icon; itemName = LocalizeModule.Instance.GetString(itemConfig.name); } }
public void Refresh(Push_Info push_gift) { if (null == push_gift) { return; } Push_Info info = push_gift; ConfPush push = ConfPush.Get(info.PushId); PushGiftData data = new PushGiftData() { m_push_gift_id = push.id, m_tex_name = push.icon, m_price_txt = GameEvents.IAPEvents.Sys_GetPriceEvent.SafeInvoke(push.chargeid), m_bought = info.Buyed, m_charge_id = push.chargeid, }; ConfProp gift_prop = ConfProp.Get(push.giftid); m_data = data; m_gift_name.Text = LocalizeModule.Instance.GetString(gift_prop.name); m_buy_btn.Visible = true; m_bought_img.Visible = false; m_price_txt.Text = m_data.m_price_txt; var prop_json_infos = CommonHelper.GetFixedDropOuts(gift_prop.dropout); m_gift_grid.EnsureSize <DropItemIcon>(prop_json_infos.Count); for (int i = 0; i < m_gift_grid.ChildCount; ++i) { DropItemIcon child = m_gift_grid.GetChild <DropItemIcon>(i); DropOutJsonData prop_json = prop_json_infos[i]; ConfProp prop = ConfProp.Get(prop_json.value); child.InitSprite(prop.icon, prop_json.count, prop_json.value); child.Visible = true; } }
public static void OpenGift(long propID, int num) { ConfProp confProp = ConfProp.Get(propID); if (confProp == null) { return; } if (confProp.type == 3 && confProp.bindType == 1) // { MessageHandler.RegisterMessageHandler(MessageDefine.SCDropResp, OnOpenGiftCallback); //MessageHandler.RegisterMessageHandler(MessageDefine.SCAutoOpenGiftDropResp, OnOpenGiftCallback); EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.gift_open.ToString()); CSDropReq req = new CSDropReq(); req.PropId = confProp.id; req.Count = num; GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req); } }
private void OnInitData(List <DropInfo> DropInfos) { m_exp = 0; int count = DropInfos.Count; m_Grid.EnsureSize <GiftContent>(count); for (int i = 0; i < count; i++) { GiftContent giftContent = m_Grid.GetChild <GiftContent>(i); giftContent.SetData(DropInfos[i]); giftContent.SetTargetTransform(this.m_bagTrans); giftContent.Visible = true; ConfProp prop = ConfProp.Get(DropInfos[i].PropId); //TODO: 放在各自系统增减装备。 //if ((int)PROP_TYPE.E_FUNC == prop.type || (int)PROP_TYPE.E_CHIP == prop.type || (int)PROP_TYPE.E_NROMAL == prop.type || (int)PROP_TYPE.E_ENERGE == prop.type) //{ // GlobalInfo.MY_PLAYER_INFO.AddSingleBagInfo(DropInfos[i].PropId, DropInfos[i].Count); //} m_exp += CommonHelper.GetPropExp(DropInfos[i].PropId, DropInfos[i].Count); } }
public void SetData(long propId, bool isUnLock) { m_confProp = ConfProp.Get(propId); if (m_confProp == null) { Visible = true; return; } if (isUnLock) { m_iconImg.Color = Color.white; m_mask.Color = Color.white; } else { m_iconImg.Color = m_maskBGColor; m_mask.Color = m_maskIconColor; } this.m_iconImg.Sprite = m_confProp.icon; }
private void Refresh() { m_from_lvl_txt.Text = string.Format("Lv.{0}", m_data.Difficulty - 1); m_to_lvl_txt.Text = string.Format("Lv.{0}", m_data.Difficulty); m_max_vit = CommonData.MAXVIT; m_cur_vit_txt.Text = GlobalInfo.MY_PLAYER_INFO.Vit.ToString(); m_max_vit_txt.Text = string.Format("/{0}", m_max_vit); m_grid.EnsureSize <DropItemIcon>(m_data.GiftItems.Count); for (int i = 0; i < m_grid.ChildCount; ++i) { ConfProp prop = ConfProp.Get(m_data.GiftItems[i].ItemId); m_grid.GetChild <DropItemIcon>(i).InitSprite(prop.icon, m_data.GiftItems[i].Num, prop.id); m_grid.GetChild <DropItemIcon>(i).Visible = true; } m_idx = 0; StepTo(++m_idx); }
public static List <PropData> getPropData(RepeatedField <PlayerPropMsg> propMsg) { if (propMsg == null) { return(new List <PropData>()); } List <PropData> propList = new List <PropData>(); for (int i = 0; i < propMsg.Count; i++) { PlayerPropMsg pd = propMsg[i]; ConfProp prop = ConfProp.Get(pd.PropId); if (prop == null) { continue; } if (prop.heapSize > 0 && prop.heapSize < pd.Count) { int cellNum = pd.Count / prop.heapSize; int finalPropNum = pd.Count % prop.heapSize; for (int j = 0; j < cellNum; j++) { PropData realPropData = new PropData(prop, prop.heapSize); propList.Add(realPropData); } if (finalPropNum != 0) { PropData realPropData = new PropData(prop, finalPropNum); propList.Add(realPropData); } } else { PropData realPropData = new PropData(prop, pd.Count); propList.Add(realPropData); } } return(propList); }
public static void ShowPropTips(long prop_id, int prop_num_, Vector3 ui_world_pos, Vector2 m_offset) { Vector2 screenPoint2 = RectTransformUtility.WorldToScreenPoint(CameraManager.Instance.UICamera, ui_world_pos); int address_count = ConfProp.Get(prop_id).address.Length; ToolTipsData data = new ToolTipsData() { ItemID = prop_id, CurCount = prop_num_, MaxCount = 0, ScreenPos = screenPoint2 - new Vector2(ToolTipsView.C_WIDTH * 0.5f + m_offset.x /* - this.Widget.sizeDelta.x * 0.5f*/, -10.0f * address_count + m_offset.y), }; FrameMgr.OpenUIParams ui_data = new FrameMgr.OpenUIParams(UIDefine.UI_TOOL_TIPS) { Param = data, }; EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(ui_data); }
protected virtual void OneUseReqCallback(long id) { if (m_itemdata == null || null == m_itemdata.m_prop) { return; } if (id == m_itemdata.m_prop.id && 1 == m_itemdata.m_number) { ConfProp confProp = ConfProp.Get(m_itemdata.m_prop.id); if (confProp != null && (confProp.type == 0 || confProp.type == 8)) { ConfSkill confSkill = ConfSkill.Get(confProp.skillId); if (confSkill != null) { WaveTipHelper.LoadWaveContent("food_add_1", confSkill.gain); } } GlobalInfo.MY_PLAYER_INFO.ReducePropForBag(id); GameEvents.UIEvents.UI_Bag_Event.OnPropCost.SafeInvoke(m_itemdata.m_prop.id); this.SwitchButton(); } }
private void PressDown(GameObject obj) { Vector2 screenPoint2 = RectTransformUtility.WorldToScreenPoint(CameraManager.Instance.UICamera, this.Widget.position); int address_count = ConfProp.Get(m_item_id).address.Length; ToolTipsData data = new ToolTipsData() { ItemID = m_item_id, CurCount = 0, MaxCount = 0, ScreenPos = screenPoint2 - new Vector2(ToolTipsView.C_WIDTH * 0.5f /* - this.Widget.sizeDelta.x * 0.5f*/, -10.0f * address_count), }; FrameMgr.OpenUIParams ui_data = new FrameMgr.OpenUIParams(UIDefine.UI_TOOL_TIPS) { Param = data, }; EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(ui_data); }
void RefreshLeftToggleByFixedID() { ConfProp prop = ConfProp.Get(m_fixed_prop_id); if ((int)PROP_TYPE.E_OFFICER == prop.type) { if (m_left_toggles[(int)ENUM_COMBINE_TYPE.POLICE].Checked) { m_left_toggles[(int)ENUM_COMBINE_TYPE.POLICE].Checked = false; } m_left_toggles[(int)ENUM_COMBINE_TYPE.POLICE].Checked = true; } else if ((int)PROP_TYPE.E_EXHABIT == prop.type) { if (m_left_toggles[(int)ENUM_COMBINE_TYPE.COLLECTION].Checked) { m_left_toggles[(int)ENUM_COMBINE_TYPE.COLLECTION].Checked = false; } m_left_toggles[(int)ENUM_COMBINE_TYPE.COLLECTION].Checked = true; } }
void ShowOutputContent(long combine_id_) { long out_put_id = ConfCombineFormula.Get(combine_id_).outputId; if (0 == out_put_id) { return; } switch (m_combine_type) { case ENUM_COMBINE_TYPE.POLICE: { m_tex_view.TextureName = ConfOfficer.Get(ConfProp.Get(out_put_id).officerId).hollowPortrait; } break; case ENUM_COMBINE_TYPE.COLLECTION: { m_3D_view.Refresh(ConfProp.Get(out_put_id).exhibit); //m_3D_view.Refresh(Confexhibit.Get(out_put_id).assetName); //int ret = UnityEngine.Random.Range(1, 3); //m_3D_view.Refresh(0 == ret % 2 ? "FaYuanWai_01_MoTuoChe_01.prefab" : "G_BaoLuoGongZuoShi_01_gangtiexia_01.prefab"); } break; case ENUM_COMBINE_TYPE.OTHER: { m_icon_view.Sprite = ConfProp.Get(out_put_id).icon; } break; default: break; } }
private void OnChooseId(long chooseId) { m_needShowRefut = false; this.m_confutBtn.Visible = false; //this.m_iconCom.Visible = true; if (chooseId == this.m_persuadeData.m_items[this.m_currentItemIndex].evidenceID) { //sure this.m_serialIconGrid.GetChild <SerialToggle>(m_persuadeIndex).SetState(true); this.m_iconImg.Sprite = ConfProp.Get(chooseId).icon; this.m_needShowIcon = true; this.m_lastItemIndex = this.m_currentItemIndex; this.m_serialIndexDic[this.m_currentItemIndex].isRecord = true; GameEvents.UIEvents.UI_Presuade_Event.OnRecordByIndex.SafeInvoke(this.m_currentItemIndex); SetCurrentValue(this.m_currentItemData.feedbackIndex); } else { //error GameEvents.UIEvents.UI_Presuade_Event.OnNoticProgressFillEffect.SafeInvoke(false); m_errorChoose = true; SetContentLab("persuade_tips", false); } }
public void SetTargetGameObjByID(long itemId) { //EUNM_BASE_REWARD typeenum = EUNM_BASE_REWARD.E_VIT; ConfProp confprop = ConfProp.Get(itemId); if (confprop == null) { return; } this.m_dropType = EUNM_BASE_REWARD.E_INVALID; if (confprop.type == 8) { this.m_dropType = EUNM_BASE_REWARD.E_VIT; } else if (confprop.type == 5) { this.m_dropType = EUNM_BASE_REWARD.E_COIN; } else if (confprop.type == 6) { this.m_dropType = EUNM_BASE_REWARD.E_CASH; } else if (confprop.type == 7) { this.m_dropType = EUNM_BASE_REWARD.E_EXP; } if (GameEvents.UIEvents.UI_Drop_Event.GetPlayerInfoGameObject == null) { return; } m_target = GameEvents.UIEvents.UI_Drop_Event.GetPlayerInfoGameObject(this.m_dropType); if (m_target == null) { m_target = m_bagTran; } }
private void AddBagInfo(long id, int count) { GameEvents.UIEvents.UI_Bag_Event.Tell_OnPropIn.SafeInvoke(id); ConfProp conf_prop = ConfProp.Get(id); if ((int)PROP_TYPE.E_FUNC == conf_prop.type || (int)PROP_TYPE.E_CHIP == conf_prop.type || (int)PROP_TYPE.E_NROMAL == conf_prop.type || (int)PROP_TYPE.E_ENERGE == conf_prop.type || (int)PROP_TYPE.E_OFFICER == conf_prop.type || (int)PROP_TYPE.E_EXHABIT == conf_prop.type || (int)PROP_TYPE.E_GIFT == conf_prop.type) { if (m_bag_infos.ContainsKey(id)) { m_bag_infos[id].Count += count; } else { PlayerPropMsg prop = new PlayerPropMsg(); prop.PropId = id; prop.Count = count; m_bag_infos.Add(id, prop); } if (m_recent_prop_infos.ContainsKey(id)) { m_recent_prop_infos[id].Count += count; } else { PlayerPropMsg prop = new PlayerPropMsg(); prop.PropId = id; prop.Count = count; m_recent_prop_infos.Add(id, prop); } } }
public static List <PropData> getPropData(PropNetworkData propData) { if (propData == null) { return(new List <PropData>()); } List <PropData> propList = new List <PropData>(); for (int i = 0; i < propData.pds.Count; i++) { PropDataNetWork pd = propData.pds[i]; ConfProp prop = ConfProp.Get(pd.id); if (prop.heapSize > 0 && prop.heapSize < pd.sum) { int cellNum = pd.sum / prop.heapSize; int finalPropNum = pd.sum % prop.heapSize; for (int j = 0; j < cellNum; j++) { PropData realPropData = new PropData(prop, prop.heapSize); propList.Add(realPropData); } if (finalPropNum != 0) { PropData realPropData = new PropData(prop, finalPropNum); propList.Add(realPropData); } } else { PropData realPropData = new PropData(prop, pd.sum); propList.Add(realPropData); } } return(propList); }
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); }
private void OnBuyCallback(MarkeBuyResponse res) { if (m_itemdata == null || m_requestType != m_curShopType) { return; } if (res.ResponseStatus != null) ////////////////TTTTT { PopUpManager.OpenNormalOnePop("shop_rmb_no"); } else { if (m_itemdata.marketID == m_requestID) { m_requestType = ShopType.None; int cost = 0; if (m_itemdata.m_hasDis) { cost = m_itemdata.m_disPrice * m_requestCount; } else { cost = m_itemdata.m_oriPrice * m_requestCount; } if (m_itemdata.m_costType == CostType.CostCash) { GlobalInfo.MY_PLAYER_INFO.ChangeCash(-cost); } else if (m_itemdata.m_costType == CostType.CostCoin) { GlobalInfo.MY_PLAYER_INFO.ChangeCoin(-cost); } PopUpManager.OpenNormalOnePop("shop_rmb_ok"); //CommonHelper.OpenGift(m_itemdata.m_prop.id, m_requestCount); if (m_is_fast_buy) { if (12 != res.Props.PropId) //火锅 { GlobalInfo.MY_PLAYER_INFO.AddSingleBagInfo(res.Props.PropId, res.Props.Count); GameEvents.UIEvents.UI_GameEntry_Event.Listen_OnCombinePropCollected.SafeInvoke(); } GameSkillManager.Instance.OnStartSkill(m_itemdata.m_prop.id, 1); } else { if (ShopType.Vit == m_curShopType) { ConfProp confProp = ConfProp.Get(m_itemdata.m_prop.id); if (confProp != null && confProp.skillId != 26) { long itemID = res.Props.PropId; int itemNum = res.Props.Count; GlobalInfo.MY_PLAYER_INFO.AddSingleBagInfo(res.Props.PropId, res.Props.Count); GameEvents.UIEvents.UI_Bag_Event.OnPropCost.SafeInvoke(m_itemdata.m_prop.id); GameEvents.UIEvents.UI_GameEntry_Event.Listen_OnCombinePropCollected.SafeInvoke(); } else if (confProp != null) { ConfSkill confskill = ConfSkill.Get(confProp.skillId); VitManager.Instance.ReflashInfiniteVitTime(confskill.duration * 1000); } } } if (m_itemdata.m_limitNumber > 0) { --m_itemdata.m_limitNumber; m_limited_buy_num_txt.Text = string.Format("({0}/{1})", m_itemdata.m_limitNumber, m_limited_max_num); if (0 == m_itemdata.m_limitNumber) { m_limited_buy_btn.Enable = false; m_limited_buy_btn.SetGray(true); } else { m_limited_buy_btn.Enable = true; m_limited_buy_btn.SetGray(false); } this.SwitchButton(); return; } if (1 == m_itemdata.m_number && false == m_itemdata.m_hasDis) { this.SwitchButton(); } } } }
private List <RewardWrapper> GetAcceptTaskDropItem(ConfTask confTask) { List <RewardWrapper> task_rewards = new List <RewardWrapper>(); long[] rewardItemIds = confTask.rewardPropIds; int[] rewardItemNums = confTask.rewardPropNums; for (int i = 0; i < rewardItemIds.Length; ++i) { var reward = ConfProp.Get(rewardItemIds[i]); task_rewards.Add(new RewardWrapper() { m_icon = reward.icon, m_num = rewardItemNums[i], m_id = rewardItemIds[i], } ); } var output = TaskHelper.GetReward(confTask); if (output.Item1 > 0) { RewardWrapper rw = new RewardWrapper() { m_id = 0, m_icon = CommonHelper.GetOutputIconName(EUNM_BASE_REWARD.E_VIT), m_num = output.Item1, }; task_rewards.Add(rw); } if (output.Item2 > 0) { RewardWrapper rw = new RewardWrapper() { m_id = 0, m_icon = CommonHelper.GetOutputIconName(EUNM_BASE_REWARD.E_COIN), m_num = output.Item2, }; task_rewards.Add(rw); } if (output.Item3 > 0) { RewardWrapper rw = new RewardWrapper() { m_id = 0, m_icon = CommonHelper.GetOutputIconName(EUNM_BASE_REWARD.E_CASH), m_num = output.Item3, }; task_rewards.Add(rw); } if (output.Item4 > 0) { RewardWrapper rw = new RewardWrapper() { m_id = 0, m_icon = CommonHelper.GetOutputIconName(EUNM_BASE_REWARD.E_EXP), m_num = output.Item4, }; task_rewards.Add(rw); } return(task_rewards); }