| | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "crystalPosList", _g_get_crystalPosList); |
| | | |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "integralRankAwardDict", _s_set_integralRankAwardDict); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "finalWarWinAwardDict", _s_set_finalWarWinAwardDict); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "finalWarChampionWinAwardDict", _s_set_finalWarChampionWinAwardDict); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "finalWarDefeatAwardDict", _s_set_finalWarDefeatAwardDict); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "finalWarChampionDefeatAwardDict", _s_set_finalWarChampionDefeatAwardDict); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "fairyLeagueResults", _s_set_fairyLeagueResults); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "crystalPosList", _s_set_crystalPosList); |
| | | |
| | |
| | | |
| | | Snxxz.UI.FairyLeagueModel gen_to_be_invoked = (Snxxz.UI.FairyLeagueModel)translator.FastGetCSObj(L, 1); |
| | | gen_to_be_invoked.integralRankAwardDict = (System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<Snxxz.UI.IntegralRankItem>>)translator.GetObject(L, 2, typeof(System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<Snxxz.UI.IntegralRankItem>>)); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_finalWarWinAwardDict(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.FairyLeagueModel gen_to_be_invoked = (Snxxz.UI.FairyLeagueModel)translator.FastGetCSObj(L, 1); |
| | | gen_to_be_invoked.finalWarWinAwardDict = (System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<Snxxz.UI.AwardItem>>)translator.GetObject(L, 2, typeof(System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<Snxxz.UI.AwardItem>>)); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_finalWarChampionWinAwardDict(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.FairyLeagueModel gen_to_be_invoked = (Snxxz.UI.FairyLeagueModel)translator.FastGetCSObj(L, 1); |
| | | gen_to_be_invoked.finalWarChampionWinAwardDict = (System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<Snxxz.UI.AwardItem>>)translator.GetObject(L, 2, typeof(System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<Snxxz.UI.AwardItem>>)); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_finalWarDefeatAwardDict(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.FairyLeagueModel gen_to_be_invoked = (Snxxz.UI.FairyLeagueModel)translator.FastGetCSObj(L, 1); |
| | | gen_to_be_invoked.finalWarDefeatAwardDict = (System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<Snxxz.UI.AwardItem>>)translator.GetObject(L, 2, typeof(System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<Snxxz.UI.AwardItem>>)); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_finalWarChampionDefeatAwardDict(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.FairyLeagueModel gen_to_be_invoked = (Snxxz.UI.FairyLeagueModel)translator.FastGetCSObj(L, 1); |
| | | gen_to_be_invoked.finalWarChampionDefeatAwardDict = (System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<Snxxz.UI.AwardItem>>)translator.GetObject(L, 2, typeof(System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<Snxxz.UI.AwardItem>>)); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetVipTitle", _m_GetVipTitle); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetTitlePower", _m_GetTitlePower); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetCTGConfigs", _m_GetCTGConfigs); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "TryGetRechargeItem", _m_TryGetRechargeItem); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "TryGetFirstReward", _m_TryGetFirstReward); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "UpdateVipGift", _m_UpdateVipGift); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "UpdateVipExp", _m_UpdateVipExp); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "UpdateVipTime", _m_UpdateVipTime); |
| | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_TryGetRechargeItem(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.VipModel gen_to_be_invoked = (Snxxz.UI.VipModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int _id = LuaAPI.xlua_tointeger(L, 2); |
| | | System.Collections.Generic.List<Snxxz.UI.AwardItem> _list; |
| | | |
| | | bool gen_ret = gen_to_be_invoked.TryGetRechargeItem( _id, out _list ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | translator.Push(L, _list); |
| | | |
| | | |
| | | |
| | | |
| | | return 2; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_TryGetFirstReward(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.VipModel gen_to_be_invoked = (Snxxz.UI.VipModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int __job = LuaAPI.xlua_tointeger(L, 2); |
| | | System.Collections.Generic.List<Snxxz.UI.AwardItem> __list; |
| | | |
| | | bool gen_ret = gen_to_be_invoked.TryGetFirstReward( __job, out __list ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | translator.Push(L, __list); |
| | | |
| | | |
| | | |
| | | |
| | | return 2; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | |
| | | this.quality = _quality;
|
| | | }
|
| | | }
|
| | |
|
| | | public struct AwardItem
|
| | | {
|
| | | public Item item;
|
| | | public int isBind;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[key].ToJson());
|
| | | for (int j = 0; j < _itemArray.Length; j++)
|
| | | {
|
| | | _award.Add(_ranking, new AwardItem()
|
| | | {
|
| | | item = new Item(_itemArray[j][0], _itemArray[j][1]),
|
| | | isBind = _itemArray[j][2],
|
| | | });
|
| | | _award.Add(_ranking, new Item(_itemArray[j][0], _itemArray[j][1]));
|
| | | }
|
| | | }
|
| | | SeasonRewardDic = _award;
|
| | |
| | | if (i < List.Count)
|
| | | {
|
| | | ObjChild.SetActive(true);
|
| | | var config = KingTreasureItemConfig.Get(List[i].item.id);
|
| | | var Itemconfig = ItemConfig.Get(List[i].item.id);
|
| | | var config = KingTreasureItemConfig.Get(List[i].id);
|
| | | var Itemconfig = ItemConfig.Get(List[i].id);
|
| | | if (config != null)
|
| | | {
|
| | | kingRewardItem.KingText.gameObject.SetActive(true);
|
| | |
| | | {
|
| | | ui.Stop();
|
| | | }
|
| | | ItemCellModel cellModel = new ItemCellModel(List[i].item.id, true, (ulong)List[i].item.count, List[i].isBind);
|
| | | ItemCellModel cellModel = new ItemCellModel(List[i].id, true, (ulong)List[i].count);
|
| | | _ItemCell.Init(cellModel);
|
| | | int type = i;
|
| | | _ItemCell.cellBtn.SetListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(List[type].item.id, false, (ulong)List[type].item.count, -1, List[type].isBind);
|
| | | ItemAttrData attrData = new ItemAttrData(List[type].id, false, (ulong)List[type].count, -1);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| | |
| | | {
|
| | | m_GridLeft.GetChild(i).gameObject.SetActive(false);
|
| | | }
|
| | | List<AwardItem> AwardItemList = new List<AwardItem>();
|
| | | List<Item> AwardItemList = new List<Item>();
|
| | | AwardItemList = RankAwardItem.GetAwardItem(12);
|
| | | for (int i = 0; i < AwardItemList.Count; i++)
|
| | | {
|
| | |
| | | m_GridLeft.GetChild(i).gameObject.SetActive(true);
|
| | | ItemCell itemCell = m_GridLeft.GetChild(i).GetComponent<ItemCell>();
|
| | | ulong Number = 0;
|
| | | Number = (ulong)AwardItemList[i].item.count;
|
| | | if (AwardItemList[i].item.id == 2103)
|
| | | Number = (ulong)AwardItemList[i].count;
|
| | | if (AwardItemList[i].id == 2103)
|
| | | {
|
| | | Equation.Instance.Clear();
|
| | | int playerlv = PlayerDatas.Instance.baseData.LV;
|
| | |
| | | Number = Equation.Instance.Eval<ulong>("reExp");
|
| | | }
|
| | |
|
| | | ItemCellModel cellModel = new ItemCellModel(AwardItemList[i].item.id, true, Number, AwardItemList[i].isBind);
|
| | | ItemCellModel cellModel = new ItemCellModel(AwardItemList[i].id, true, Number);
|
| | | itemCell.Init(cellModel);
|
| | | int tab = i;
|
| | | itemCell.cellBtn.SetListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(AwardItemList[tab].item.id, false, Number, -1, AwardItemList[tab].isBind);
|
| | | ItemAttrData attrData = new ItemAttrData(AwardItemList[tab].id, false, Number, -1);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| | |
| | | var _jsonData = LitJson.JsonMapper.ToObject(runTaskAward.Numerical3);
|
| | | if (runTaskAward.Numerical4 != string.Empty)//经验
|
| | | {
|
| | | _award.Add(12, new AwardItem()
|
| | | {
|
| | | item = new Item(2103, 1),
|
| | | isBind = 1,
|
| | | });
|
| | | _award.Add(12, new Item(2103, 1));
|
| | | }
|
| | | foreach (string key in _jsonData.Keys)
|
| | | {
|
| | |
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[key].ToJson());
|
| | | for (int j = 0; j < _itemArray.Length; j++)
|
| | | {
|
| | | _award.Add(_job, new AwardItem()
|
| | | {
|
| | | item = new Item(_itemArray[j][0], _itemArray[j][1]),
|
| | | isBind = _itemArray[j][2],
|
| | | });
|
| | | _award.Add(_job, new Item(_itemArray[j][0], _itemArray[j][1]));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | /// <summary>
|
| | | /// key----世界等级
|
| | | /// </summary>
|
| | | public Dictionary<int, List<AwardItem>> finalWarWinAwardDict = new Dictionary<int, List<AwardItem>>();
|
| | | public Dictionary<int, List<AwardItem>> finalWarChampionWinAwardDict = new Dictionary<int, List<AwardItem>>();
|
| | | public Dictionary<int, List<AwardItem>> finalWarDefeatAwardDict = new Dictionary<int, List<AwardItem>>();
|
| | | public Dictionary<int, List<AwardItem>> finalWarChampionDefeatAwardDict = new Dictionary<int, List<AwardItem>>();
|
| | | public Dictionary<int, List<Item>> finalWarWinAwardDict = new Dictionary<int, List<Item>>();
|
| | | public Dictionary<int, List<Item>> finalWarChampionWinAwardDict = new Dictionary<int, List<Item>>();
|
| | | public Dictionary<int, List<Item>> finalWarDefeatAwardDict = new Dictionary<int, List<Item>>();
|
| | | public Dictionary<int, List<Item>> finalWarChampionDefeatAwardDict = new Dictionary<int, List<Item>>();
|
| | | private Dictionary<int, float> crystalRateDict = new Dictionary<int, float>();
|
| | | readonly List<int> fairyLeagueStateValues = new List<int>() { 11, 12, 13, 21, 22, 23 };
|
| | | FairyLeagueWeekTime fairyLeagueWeekTime = new FairyLeagueWeekTime();
|
| | |
| | | foreach (Match match in _regex.Matches(cfg.Numerical1))
|
| | | {
|
| | | var _worldLv = int.Parse(match.Groups[1].Value);
|
| | | List<AwardItem> _list = ParseAward(StringUtility.Contact('[', match.Groups[2].Value, ']'));
|
| | | List<Item> _list = ParseAward(StringUtility.Contact('[', match.Groups[2].Value, ']'));
|
| | | finalWarWinAwardDict.Add(_worldLv, _list);
|
| | | }
|
| | | }
|
| | |
| | | foreach (Match match in _regex.Matches(cfg.Numerical2))
|
| | | {
|
| | | var _worldLv = int.Parse(match.Groups[1].Value);
|
| | | List<AwardItem> _list = ParseAward(StringUtility.Contact('[', match.Groups[2].Value, ']'));
|
| | | List<Item> _list = ParseAward(StringUtility.Contact('[', match.Groups[2].Value, ']'));
|
| | | finalWarDefeatAwardDict.Add(_worldLv, _list);
|
| | | }
|
| | | }
|
| | |
| | | foreach (Match match in _regex.Matches(cfg.Numerical1))
|
| | | {
|
| | | var _worldLv = int.Parse(match.Groups[1].Value);
|
| | | List<AwardItem> _list = ParseAward(StringUtility.Contact('[', match.Groups[2].Value, ']'));
|
| | | List<Item> _list = ParseAward(StringUtility.Contact('[', match.Groups[2].Value, ']'));
|
| | | finalWarChampionWinAwardDict.Add(_worldLv, _list);
|
| | | }
|
| | | }
|
| | |
| | | foreach (Match match in _regex.Matches(cfg.Numerical2))
|
| | | {
|
| | | var _worldLv = int.Parse(match.Groups[1].Value);
|
| | | List<AwardItem> _list = ParseAward(StringUtility.Contact('[', match.Groups[2].Value, ']'));
|
| | | List<Item> _list = ParseAward(StringUtility.Contact('[', match.Groups[2].Value, ']'));
|
| | | finalWarChampionDefeatAwardDict.Add(_worldLv, _list);
|
| | | }
|
| | | }
|
| | |
| | | return index;
|
| | | }
|
| | |
|
| | | private List<AwardItem> ParseAward(string _config)
|
| | | private List<Item> ParseAward(string _config)
|
| | | {
|
| | | List<AwardItem> _list = new List<AwardItem>();
|
| | | List<Item> _list = new List<Item>();
|
| | | var _array = JsonMapper.ToObject<int[][]>(_config);
|
| | | if (_array != null)
|
| | | {
|
| | | for (int i = 0; i < _array.Length; i++)
|
| | | {
|
| | | AwardItem _item = new AwardItem();
|
| | | _item.item.id = _array[i][0];
|
| | | _item.item.count = _array[i][1];
|
| | | _item.isBind = _array[i][2];
|
| | | Item _item = new Item();
|
| | | _item.id = _array[i][0];
|
| | | _item.count = _array[i][1];
|
| | | _item.bind = _array[i][2] == 1;
|
| | | _list.Add(_item);
|
| | | }
|
| | | }
|
| | |
| | | m_ChampionAwardBtn.onClick.RemoveAllListeners();
|
| | | if (model.fairyLeagueGroupId == 5 && (winChampion || defeatChampion))
|
| | | {
|
| | | Dictionary<int, List<AwardItem>> _dict = null;
|
| | | Dictionary<int, List<Item>> _dict = null;
|
| | | if (winChampion)
|
| | | {
|
| | | _dict = (model.fairyLeagueSession == 1 && model.fairyLeagueHelp.fairyWarEnter.IsFinalMatch == 1) ?
|
| | |
| | | {
|
| | | _rankKey = UIHelper.GetIntervalAward(_dict.Keys, (int)PlayerDatas.Instance.worldLv);
|
| | | var _Award = _dict[_rankKey][0];
|
| | | m_ChampionAward.Init(_Award.item.id, Mathf.Min(1, _Award.item.count), _Award.isBind);
|
| | | m_ChampionAward.Init(_Award.id, Mathf.Min(1, _Award.count));
|
| | | m_ChampionAwardBtn.onClick.AddListener(() =>
|
| | | {
|
| | | ItemAttrData _itemData = new ItemAttrData(_Award.item.id, false, (ulong)_Award.item.count, -1, _Award.isBind);
|
| | | ItemAttrData _itemData = new ItemAttrData(_Award.id, false, (ulong)_Award.count, -1);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(_itemData);
|
| | | });
|
| | | }
|
| | |
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[_key].ToJson());
|
| | | for (int j = 0; j < _itemArray.Length; j++)
|
| | | {
|
| | | _award.Add(_job, new AwardItem()
|
| | | {
|
| | | item = new Item(_itemArray[j][0], _itemArray[j][1]),
|
| | | isBind = 1,
|
| | | });
|
| | | _award.Add(_job, new Item(_itemArray[j][0], _itemArray[j][1]));
|
| | | }
|
| | | }
|
| | | DicAwardItem.Add(functionForecastConfig.FuncId, _award);
|
| | |
| | | private void SetRankAwardItem(int funcID)
|
| | | {
|
| | | ImpactRankModel.RankAwardItem rankAward = featureNoticeModel.DicAwardItem[funcID];
|
| | | List<AwardItem> List = rankAward.GetAwardItem(PlayerDatas.Instance.baseData.Job);
|
| | | List<Item> List = rankAward.GetAwardItem(PlayerDatas.Instance.baseData.Job);
|
| | |
|
| | | if (List.Count <= 1)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | } |
| | | private void SetItem1(List<AwardItem> List,int funcID)
|
| | | private void SetItem1(List<Item> List,int funcID)
|
| | | {
|
| | | var itemConfig = ItemConfig.Get(List[0].item.id);
|
| | | var itemConfig = ItemConfig.Get(List[0].id);
|
| | | UIHelper.SetItemBackGround(m_ItemBG1, itemConfig.ItemColor);
|
| | | m_Icon1.SetSprite(itemConfig.IconKey);
|
| | | m_IconBtn1.SetListener(() =>
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(List[0].item.id, false, (ulong)List[0].item.count, -1, List[0].isBind);
|
| | | ItemAttrData attrData = new ItemAttrData(List[0].id, false, (ulong)List[0].count, -1);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | | // DebugEx.LogError("弹框");
|
| | | }
|
| | |
|
| | | });
|
| | | if (List[0].item.count > 1)
|
| | | if (List[0].count > 1)
|
| | | {
|
| | | m_Number1.gameObject.SetActive(true);
|
| | | m_Number1.text = List[0].item.count.ToString();
|
| | | m_Number1.text = List[0].count.ToString();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Number1.gameObject.SetActive(false);
|
| | | }
|
| | | if (List[0].isBind==1)
|
| | | {
|
| | | m_Lock1.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Lock1.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | m_Lock1.gameObject.SetActive(false);
|
| | | if (FuncOpen.Instance.IsFuncOpen(funcID))
|
| | | {
|
| | | m_ItemBG1.gray = false;
|
| | |
| | | m_HasReceived1.SetActive(false);
|
| | | }
|
| | | }
|
| | | private void SetItem2(List<AwardItem> List, int funcID)
|
| | | private void SetItem2(List<Item> List, int funcID)
|
| | | {
|
| | | var itemConfig = ItemConfig.Get(List[1].item.id);
|
| | | var itemConfig = ItemConfig.Get(List[1].id);
|
| | | UIHelper.SetItemBackGround(m_ItemBG2, itemConfig.ItemColor);
|
| | | m_Icon2.SetSprite(itemConfig.IconKey);
|
| | | m_IconBtn2.SetListener(() =>
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(List[1].item.id, false, (ulong)List[1].item.count, -1, List[1].isBind);
|
| | | ItemAttrData attrData = new ItemAttrData(List[1].id, false, (ulong)List[1].count, -1);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | | //DebugEx.LogError("弹框");
|
| | | }
|
| | | });
|
| | | if (List[1].item.count > 1)
|
| | | if (List[1].count > 1)
|
| | | {
|
| | | m_Number2.gameObject.SetActive(true);
|
| | | m_Number2.text = List[1].item.count.ToString();
|
| | | m_Number2.text = List[1].count.ToString();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Number2.gameObject.SetActive(false);
|
| | | }
|
| | | if (List[1].isBind==1)
|
| | | {
|
| | | m_Lock2.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Lock2.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | m_Lock2.gameObject.SetActive(false);
|
| | | if (FuncOpen.Instance.IsFuncOpen(funcID))
|
| | | {
|
| | | m_ItemBG2.gray = false;
|
| | |
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[_key].ToJson());
|
| | | for (int j = 0; j < _itemArray.Length; j++)
|
| | | {
|
| | | _award.Add(_job, new AwardItem()
|
| | | {
|
| | | item = new Item(_itemArray[j][0], _itemArray[j][1]),
|
| | | isBind = _itemArray[j][2],
|
| | | });
|
| | | _award.Add(_job, new Item(_itemArray[j][0], _itemArray[j][1]));
|
| | | }
|
| | | }
|
| | | _awardList.Add(_award);
|
| | |
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[_key].ToJson());
|
| | | for (int j = 0; j < _itemArray.Length; j++)
|
| | | {
|
| | | _award.Add(_job, new AwardItem()
|
| | | {
|
| | | item = new Item(_itemArray[j][0], _itemArray[j][1]),
|
| | | isBind = 1,
|
| | | });
|
| | | _award.Add(_job, new Item(_itemArray[j][0], _itemArray[j][1]));
|
| | | }
|
| | | }
|
| | | _awardList.Add(_award);
|
| | |
| | |
|
| | | public class RankAwardItem
|
| | | {
|
| | | private Dictionary<int, List<AwardItem>> m_AwardDict = new Dictionary<int, List<AwardItem>>();
|
| | | public Dictionary<int, List<AwardItem>> AwardDic
|
| | | private Dictionary<int, List<Item>> m_AwardDict = new Dictionary<int, List<Item>>();
|
| | | public Dictionary<int, List<Item>> AwardDic
|
| | | {
|
| | | get { return m_AwardDict; }
|
| | | }
|
| | | public List<AwardItem> GetAwardItem(int _job)
|
| | | public List<Item> GetAwardItem(int _job)
|
| | | {
|
| | | List<AwardItem> _items = null;
|
| | | List<Item> _items = null;
|
| | | m_AwardDict.TryGetValue(_job, out _items);
|
| | | return _items;
|
| | | }
|
| | |
|
| | | public void Add(int _job, AwardItem _item)
|
| | | public void Add(int _job, Item _item)
|
| | | {
|
| | | List<AwardItem> _list = null;
|
| | | List<Item> _list = null;
|
| | | if (!m_AwardDict.TryGetValue(_job, out _list))
|
| | | {
|
| | | _list = new List<AwardItem>();
|
| | | _list = new List<Item>();
|
| | | m_AwardDict.Add(_job, _list);
|
| | | }
|
| | | _list.Add(_item);
|
| | |
| | | if (_itemList != null && i < _itemList.Count)
|
| | | {
|
| | | var _item = _itemList[i];
|
| | | ItemCellModel _ItemData = new ItemCellModel(_item.item.id, false, (ulong)_item.item.count,
|
| | | _item.isBind);
|
| | | ItemCellModel _ItemData = new ItemCellModel(_item.id, false, (ulong)_item.count);
|
| | | _cell.items[i].SetItemRare(_ItemData, 5);
|
| | | _cell.items[i].cellBtn.RemoveAllListeners();
|
| | | _cell.items[i].cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData _itemPropertyData = new ItemAttrData(_item.item.id, false, (ulong)_item.item.count, -1,
|
| | | _item.isBind);
|
| | | ItemAttrData _itemPropertyData = new ItemAttrData(_item.id, false, (ulong)_item.count, -1);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(_itemPropertyData);
|
| | | });
|
| | | }
|
| | |
| | | }
|
| | | ImpactRankModel.RankAwardItem RankAwardItem = inSevenDayModel.InSevenDayDic[inDay].RankAwardItem;
|
| | | int Job = PlayerDatas.Instance.baseData.Job;
|
| | | List<AwardItem> list = RankAwardItem.GetAwardItem(Job);
|
| | | List<Item> list = RankAwardItem.GetAwardItem(Job);
|
| | | if (list.Count > 0)
|
| | | {
|
| | | AwardItem item = list[0];
|
| | | ItemCellModel cellModel = new ItemCellModel(item.item.id, true, (ulong)item.item.count, item.isBind);
|
| | | Item item = list[0];
|
| | | ItemCellModel cellModel = new ItemCellModel(item.id, true, (ulong)item.count);
|
| | | m_ItemCell.Init(cellModel);
|
| | | m_ItemCell.cellBtn.RemoveAllListeners();
|
| | | m_ItemCell.cellBtn.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(item.item.id, false, (ulong)item.item.count, -1, item.isBind);
|
| | | ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count, -1);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| | |
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[key].ToJson());
|
| | | for (int j = 0; j < _itemArray.Length; j++)
|
| | | {
|
| | | _award.Add(_job, new AwardItem()
|
| | | {
|
| | | item = new Item(_itemArray[j][0], _itemArray[j][1]),
|
| | | isBind = 1,
|
| | | });
|
| | | _award.Add(_job, new Item(_itemArray[j][0], _itemArray[j][1]));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | } |
| | | public class MonthlyInvestmentItem |
| | | { |
| | | private Dictionary<int, List<AwardItem>> m_AwardDict = new Dictionary<int, List<AwardItem>>(); |
| | | private Dictionary<int, List<Item>> m_AwardDict = new Dictionary<int, List<Item>>(); |
| | | |
| | | public List<AwardItem> GetAwardItem(int _job) |
| | | public List<Item> GetAwardItem(int _job) |
| | | { |
| | | List<AwardItem> _items = null; |
| | | List<Item> _items = null; |
| | | m_AwardDict.TryGetValue(_job, out _items); |
| | | return _items; |
| | | } |
| | | public void Add(int _job, AwardItem _item) |
| | | public void Add(int _job, Item _item) |
| | | { |
| | | List<AwardItem> _list = null; |
| | | List<Item> _list = null; |
| | | if (!m_AwardDict.TryGetValue(_job, out _list)) |
| | | { |
| | | _list = new List<AwardItem>(); |
| | | _list = new List<Item>(); |
| | | m_AwardDict.Add(_job, _list); |
| | | } |
| | | _list.Add(_item); |
| | |
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[key].ToJson()); |
| | | for (int j = 0; j < _itemArray.Length; j++) |
| | | { |
| | | _monthyItem.Add(_job, new AwardItem() |
| | | { |
| | | item = new Item(_itemArray[j][0], _itemArray[j][1]), |
| | | isBind = _itemArray[j][2], |
| | | }); |
| | | _monthyItem.Add(_job, new Item(_itemArray[j][0], _itemArray[j][1])); |
| | | } |
| | | } |
| | | monthlyInvestment.monthlyInvestmentItem = _monthyItem; |
| | |
| | | { |
| | | if (monthlyInvestmentModel.MonthlyInvestmentDic.ContainsKey(Day)) |
| | | { |
| | | List<AwardItem> monthlyInvestmentItem = monthlyInvestmentModel.MonthlyInvestmentDic[Day].monthlyInvestmentItem.GetAwardItem(1); |
| | | List<Item> monthlyInvestmentItem = monthlyInvestmentModel.MonthlyInvestmentDic[Day].monthlyInvestmentItem.GetAwardItem(1); |
| | | for (int i = 0; i < m_Group.childCount; i++) |
| | | { |
| | | if (i < monthlyInvestmentItem.Count) |
| | | { |
| | | m_Group.GetChild(i).gameObject.SetActive(true); |
| | | AwardItem item = monthlyInvestmentItem[i]; |
| | | Item item = monthlyInvestmentItem[i]; |
| | | MotnlyItem motnlyItem = m_Group.GetChild(i).GetComponent<MotnlyItem>(); |
| | | var Item = ItemConfig.Get(item.item.id); |
| | | ItemCellModel cellModel = new ItemCellModel(item.item.id, true, (ulong)1, item.isBind); |
| | | var Item = ItemConfig.Get(item.id); |
| | | ItemCellModel cellModel = new ItemCellModel(item.id, true, (ulong)1); |
| | | motnlyItem.Item_Cell.Init(cellModel); |
| | | motnlyItem.NameText.text = Item.ItemName; |
| | | motnlyItem.MoneyNumberText.text = item.item.count.ToString(); |
| | | motnlyItem.MoneyNumberText.text = item.count.ToString(); |
| | | motnlyItem.MoneyImage.SetSprite(Item.IconKey); |
| | | } |
| | | else |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Monday, March 05, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class RewardInformation : MonoBehaviour |
| | | { |
| | | [SerializeField] Text m_Days; |
| | | [SerializeField] Transform m_Group; |
| | | [SerializeField] Button m_ReceiveAwardBtn; |
| | | [SerializeField] Image m_AlreadyReceivedImage; |
| | | [SerializeField] Text m_IncentiveValue; |
| | | [SerializeField] Text m_TimeRemaining; |
| | | |
| | | InSevenDayModel m_InSevenDayModel; |
| | | InSevenDayModel inSevenDay { get { return m_InSevenDayModel ?? (m_InSevenDayModel = ModelCenter.Instance.GetModel<InSevenDayModel>()); } } |
| | | ItemTipsModel _itemTipsModel; |
| | | ItemTipsModel itemTipsModel { get { return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>()); } } |
| | | private void Start() |
| | | { |
| | | } |
| | | |
| | | |
| | | public void GetIsDays(int Day) |
| | | { |
| | | |
| | | DayText(Day);//天数赋值 |
| | | IsResidualAward(Day); |
| | | var GetInSevenDay = inSevenDay.InSevenDayDic[Day]; |
| | | m_IncentiveValue.text =string.Format(Language.Get("IncentiveValue"), GetInSevenDay.Money); |
| | | int Job = PlayerDatas.Instance.baseData.Job; |
| | | List<AwardItem> list = GetInSevenDay.RankAwardItem.GetAwardItem(Job); |
| | | for (int i = 0; i < m_Group.childCount; i++) |
| | | { |
| | | GameObject obj = m_Group.GetChild(i).gameObject; |
| | | if (i < list.Count) |
| | | { |
| | | if (!obj.activeSelf) |
| | | { |
| | | obj.SetActive(true); |
| | | } |
| | | ItemCell itemCell = obj.GetComponent<ItemCell>(); |
| | | AwardItem item = list[i]; |
| | | ItemCellModel cellModel = new ItemCellModel(item.item.id, true, (ulong)item.item.count, item.isBind); |
| | | itemCell.Init(cellModel); |
| | | itemCell.cellBtn.RemoveAllListeners(); |
| | | itemCell.cellBtn.AddListener(() => |
| | | { |
| | | ItemAttrData attrData = new ItemAttrData(item.item.id, false, (ulong)item.item.count, -1, item.isBind); |
| | | itemTipsModel.SetItemTipsModel(attrData); |
| | | }); |
| | | } |
| | | |
| | | else |
| | | { |
| | | if (obj.activeSelf) |
| | | { |
| | | obj.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | private void IsResidualAward(int day)//是否领取奖励 |
| | | { |
| | | int type = inSevenDay.RewardForDic[day]; |
| | | switch (type) |
| | | { |
| | | case -1://不可领 |
| | | m_AlreadyReceivedImage.gameObject.SetActive(false); |
| | | m_ReceiveAwardBtn.gameObject.SetActive(false); |
| | | m_TimeRemaining.gameObject.SetActive(true); |
| | | int TimeRemaining = day - inSevenDay.DayCnt; |
| | | if (TimeRemaining > 1) |
| | | { |
| | | m_TimeRemaining.text = string.Format(Language.Get("Rest_Time"), TimeRemaining); |
| | | } |
| | | else |
| | | { |
| | | m_TimeRemaining.text = Language.Get("Tomorrow_Draw"); |
| | | } |
| | | break; |
| | | case 0://可领 |
| | | m_AlreadyReceivedImage.gameObject.SetActive(false); |
| | | m_TimeRemaining.gameObject.SetActive(false); |
| | | m_ReceiveAwardBtn.gameObject.SetActive(true); |
| | | m_ReceiveAwardBtn.RemoveAllListeners(); |
| | | m_ReceiveAwardBtn.AddListener(()=> |
| | | { |
| | | inSevenDay.ReceiveAward(day); |
| | | }); |
| | | break; |
| | | case 1://已领 |
| | | m_AlreadyReceivedImage.gameObject.SetActive(true); |
| | | m_TimeRemaining.gameObject.SetActive(false); |
| | | m_ReceiveAwardBtn.gameObject.SetActive(false); |
| | | break; |
| | | default: |
| | | break; |
| | | |
| | | } |
| | | |
| | | } |
| | | private void DayText(int day) |
| | | { |
| | | switch (day) |
| | | { |
| | | case 1: |
| | | m_Days.text = Language.Get("One_day"); |
| | | break; |
| | | case 2: |
| | | m_Days.text = Language.Get("Two_day"); |
| | | break; |
| | | case 3: |
| | | m_Days.text = Language.Get("Three_day"); |
| | | break; |
| | | case 4: |
| | | m_Days.text = Language.Get("Four_day"); |
| | | break; |
| | | case 5: |
| | | m_Days.text = Language.Get("Five_day"); |
| | | break; |
| | | case 6: |
| | | m_Days.text = Language.Get("Six_day"); |
| | | break; |
| | | case 7: |
| | | m_Days.text = Language.Get("Seven_day"); |
| | | break; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Monday, March 05, 2018
|
| | | //--------------------------------------------------------
|
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using UnityEngine.UI;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class RewardInformation : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Text m_Days;
|
| | | [SerializeField] Transform m_Group;
|
| | | [SerializeField] Button m_ReceiveAwardBtn;
|
| | | [SerializeField] Image m_AlreadyReceivedImage;
|
| | | [SerializeField] Text m_IncentiveValue;
|
| | | [SerializeField] Text m_TimeRemaining;
|
| | |
|
| | | InSevenDayModel m_InSevenDayModel;
|
| | | InSevenDayModel inSevenDay { get { return m_InSevenDayModel ?? (m_InSevenDayModel = ModelCenter.Instance.GetModel<InSevenDayModel>()); } }
|
| | | ItemTipsModel _itemTipsModel;
|
| | | ItemTipsModel itemTipsModel { get { return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>()); } }
|
| | | private void Start()
|
| | | {
|
| | | }
|
| | |
|
| | |
|
| | | public void GetIsDays(int Day)
|
| | | {
|
| | |
|
| | | DayText(Day);//天数赋值
|
| | | IsResidualAward(Day);
|
| | | var GetInSevenDay = inSevenDay.InSevenDayDic[Day];
|
| | | m_IncentiveValue.text =string.Format(Language.Get("IncentiveValue"), GetInSevenDay.Money);
|
| | | int Job = PlayerDatas.Instance.baseData.Job;
|
| | | List<Item> list = GetInSevenDay.RankAwardItem.GetAwardItem(Job);
|
| | | for (int i = 0; i < m_Group.childCount; i++)
|
| | | {
|
| | | GameObject obj = m_Group.GetChild(i).gameObject;
|
| | | if (i < list.Count)
|
| | | {
|
| | | if (!obj.activeSelf)
|
| | | {
|
| | | obj.SetActive(true);
|
| | | }
|
| | | ItemCell itemCell = obj.GetComponent<ItemCell>();
|
| | | Item item = list[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(item.id, true, (ulong)item.count);
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count, -1);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| | |
|
| | | else
|
| | | {
|
| | | if (obj.activeSelf)
|
| | | {
|
| | | obj.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | | private void IsResidualAward(int day)//是否领取奖励
|
| | | {
|
| | | int type = inSevenDay.RewardForDic[day];
|
| | | switch (type)
|
| | | {
|
| | | case -1://不可领
|
| | | m_AlreadyReceivedImage.gameObject.SetActive(false);
|
| | | m_ReceiveAwardBtn.gameObject.SetActive(false);
|
| | | m_TimeRemaining.gameObject.SetActive(true);
|
| | | int TimeRemaining = day - inSevenDay.DayCnt;
|
| | | if (TimeRemaining > 1)
|
| | | {
|
| | | m_TimeRemaining.text = string.Format(Language.Get("Rest_Time"), TimeRemaining);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_TimeRemaining.text = Language.Get("Tomorrow_Draw");
|
| | | }
|
| | | break;
|
| | | case 0://可领
|
| | | m_AlreadyReceivedImage.gameObject.SetActive(false);
|
| | | m_TimeRemaining.gameObject.SetActive(false);
|
| | | m_ReceiveAwardBtn.gameObject.SetActive(true);
|
| | | m_ReceiveAwardBtn.RemoveAllListeners();
|
| | | m_ReceiveAwardBtn.AddListener(()=> |
| | | {
|
| | | inSevenDay.ReceiveAward(day);
|
| | | });
|
| | | break;
|
| | | case 1://已领
|
| | | m_AlreadyReceivedImage.gameObject.SetActive(true);
|
| | | m_TimeRemaining.gameObject.SetActive(false);
|
| | | m_ReceiveAwardBtn.gameObject.SetActive(false);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | | private void DayText(int day)
|
| | | {
|
| | | switch (day)
|
| | | {
|
| | | case 1:
|
| | | m_Days.text = Language.Get("One_day");
|
| | | break;
|
| | | case 2:
|
| | | m_Days.text = Language.Get("Two_day");
|
| | | break;
|
| | | case 3:
|
| | | m_Days.text = Language.Get("Three_day");
|
| | | break;
|
| | | case 4:
|
| | | m_Days.text = Language.Get("Four_day");
|
| | | break;
|
| | | case 5:
|
| | | m_Days.text = Language.Get("Five_day");
|
| | | break;
|
| | | case 6:
|
| | | m_Days.text = Language.Get("Six_day");
|
| | | break;
|
| | | case 7:
|
| | | m_Days.text = Language.Get("Seven_day");
|
| | | break;
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
| | | {
|
| | | if (rechargeId != 0)
|
| | | {
|
| | | List<AwardItem> items;
|
| | | List<Item> items;
|
| | | if (vipModel.TryGetRechargeItem(rechargeId, out items))
|
| | | {
|
| | | if (index < items.Count)
|
| | | {
|
| | | var item = items[index];
|
| | | ItemAttrData attrData = new ItemAttrData(item.item.id, false, (ulong)item.item.count, -1, item.isBind);
|
| | | ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count, -1);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(attrData);
|
| | | }
|
| | | }
|
| | |
| | | public void Display(int id)
|
| | | {
|
| | | rechargeId = id;
|
| | | List<AwardItem> items;
|
| | | List<Item> items;
|
| | | bool hasItem = vipModel.TryGetRechargeItem(id, out items);
|
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | |
| | | {
|
| | | m_Items[i].gameObject.SetActive(true);
|
| | | var _item = items[i];
|
| | | var _itemModel = new ItemCellModel(_item.item.id, false, (ulong)_item.item.count, _item.isBind);
|
| | | var _itemModel = new ItemCellModel(_item.id, false, (ulong)_item.count);
|
| | | m_Items[i].SetItemRare(_itemModel, i == 0);
|
| | | }
|
| | | else
|
| | |
| | | public int progress { get; private set; }
|
| | | public int totalProgress { get; private set; }
|
| | | public int effectValue { get; private set; }
|
| | | public List<AwardItem> items { get; private set; }
|
| | | public List<Item> items { get; private set; }
|
| | | public Dictionary<int, int> propertyDict { get; private set; }
|
| | | public Redpoint redpoint { get; private set; }
|
| | | public Redpoint privilegeRedpoint { get; private set; }
|
| | |
| | | var itemArray = LitJson.JsonMapper.ToObject<int[][]>(config.itemAward);
|
| | | if (itemArray != null && itemArray.Length > 0)
|
| | | {
|
| | | items = new List<AwardItem>();
|
| | | items = new List<Item>();
|
| | | for (int i = 0; i < itemArray.Length; i++)
|
| | | {
|
| | | var _array = itemArray[i];
|
| | | items.Add(new AwardItem()
|
| | | {
|
| | | isBind = _array[2],
|
| | | item = new Item()
|
| | | {
|
| | | id = _array[0],
|
| | | count = _array[1],
|
| | | },
|
| | | });
|
| | | items.Add(new Item(_array[0], _array[1]));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | if (special.items != null && i < special.items.Count)
|
| | | {
|
| | | var award = special.items[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(award.item.id, true, (ulong)award.item.count, award.isBind);
|
| | | ItemCellModel cellModel = new ItemCellModel(award.id, true, (ulong)award.count);
|
| | | m_Items[i].Init(cellModel);
|
| | | m_Items[i].cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(award.item.id, true, (ulong)award.item.count, -1, award.isBind);
|
| | | ItemAttrData attrData = new ItemAttrData(award.id, true, (ulong)award.count, -1);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | List<AwardItem> fairyJadeInvestmentItem = Dit[Lv].FairyJadeInvestmentItem.GetAwardItem(InvestmentGrade);
|
| | | List<Item> fairyJadeInvestmentItem = Dit[Lv].FairyJadeInvestmentItem.GetAwardItem(InvestmentGrade);
|
| | | int AtPresentNumber = 0;
|
| | |
|
| | | if (IsReceive != 0)
|
| | | {
|
| | | List<AwardItem> fairyJadeInvestmentItemAdd = Dit[Lv].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
|
| | | AwardItem itemAdd = fairyJadeInvestmentItemAdd[0];
|
| | | AtPresentNumber = itemAdd.item.count;
|
| | | List<Item> fairyJadeInvestmentItemAdd = Dit[Lv].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
|
| | | Item itemAdd = fairyJadeInvestmentItemAdd[0];
|
| | | AtPresentNumber = itemAdd.count;
|
| | | }
|
| | | if (fairyJadeInvestmentItem[0].item.count > AtPresentNumber)
|
| | | if (fairyJadeInvestmentItem[0].count > AtPresentNumber)
|
| | | {
|
| | | m_ReceiveAwardBtn.gameObject.SetActive(true);
|
| | | m_Uieffect.gameObject.SetActive(true);
|
| | |
| | |
|
| | |
|
| | | }
|
| | | List<AwardItem> fairyJadeInvestmentItem = Dit[Lv].FairyJadeInvestmentItem.GetAwardItem(grade);
|
| | | List<Item> fairyJadeInvestmentItem = Dit[Lv].FairyJadeInvestmentItem.GetAwardItem(grade);
|
| | | int indexID = Dit[Lv].ID;
|
| | | int IsReceive = 0;
|
| | | var dit = fairyJadeInvestmentModel.GetInfoSeriors();
|
| | |
| | | if (i < fairyJadeInvestmentItem.Count)
|
| | | {
|
| | | m_Group.GetChild(i).gameObject.SetActive(true);
|
| | | AwardItem item = fairyJadeInvestmentItem[i];
|
| | | Item item = fairyJadeInvestmentItem[i];
|
| | | MotnlyItem motnlyItem = m_Group.GetChild(i).GetComponent<MotnlyItem>();
|
| | | var Item = ItemConfig.Get(item.item.id);
|
| | | ItemCellModel cellModel = new ItemCellModel(item.item.id, true, (ulong)1, item.isBind);
|
| | | var Item = ItemConfig.Get(item.id);
|
| | | ItemCellModel cellModel = new ItemCellModel(item.id, true, (ulong)1);
|
| | | motnlyItem.Item_Cell.Init(cellModel);
|
| | |
|
| | | if (IsReceive == 0)
|
| | | {
|
| | | if (Lv <= 0)
|
| | | {
|
| | | motnlyItem.NameText.text = string.Format(Language.Get("FairyJadeInvestment_3"), item.item.count);
|
| | | motnlyItem.NameText.text = string.Format(Language.Get("FairyJadeInvestment_3"), item.count);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | int GetValue = Mathf.FloorToInt((GetFairyJadeNumber / ShowLinesNumber) * 100);
|
| | | motnlyItem.NameText.text = string.Format(Language.Get("FairyJadeInvestment_10"), Lv, GetValue);
|
| | | }
|
| | | motnlyItem.MoneyNumberText.text = item.item.count.ToString();
|
| | | motnlyItem.MoneyNumberText.text = item.count.ToString();
|
| | | }
|
| | | else
|
| | | {
|
| | | int AtPresentNumber = 0;
|
| | | if (IsReceive != 0)
|
| | | {
|
| | | List<AwardItem> fairyJadeInvestmentItemAdd = Dit[Lv].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
|
| | | AwardItem itemAdd = fairyJadeInvestmentItemAdd[i];
|
| | | AtPresentNumber = itemAdd.item.count;
|
| | | List<Item> fairyJadeInvestmentItemAdd = Dit[Lv].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
|
| | | Item itemAdd = fairyJadeInvestmentItemAdd[i];
|
| | | AtPresentNumber = itemAdd.count;
|
| | | }
|
| | |
|
| | | if (item.item.count > AtPresentNumber)
|
| | | if (item.count > AtPresentNumber)
|
| | | {
|
| | | motnlyItem.NameText.text = string.Format(Language.Get("FairyJadeInvestment_5"), (item.item.count - AtPresentNumber));
|
| | | motnlyItem.MoneyNumberText.text = (item.item.count - AtPresentNumber).ToString();
|
| | | motnlyItem.NameText.text = string.Format(Language.Get("FairyJadeInvestment_5"), (item.count - AtPresentNumber));
|
| | | motnlyItem.MoneyNumberText.text = (item.count - AtPresentNumber).ToString();
|
| | | }
|
| | | else
|
| | | {
|
| | | motnlyItem.NameText.text = string.Format(Language.Get("FairyJadeInvestment_6"), item.item.count);
|
| | | motnlyItem.MoneyNumberText.text = item.item.count.ToString();
|
| | | motnlyItem.NameText.text = string.Format(Language.Get("FairyJadeInvestment_6"), item.count);
|
| | | motnlyItem.MoneyNumberText.text = item.count.ToString();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (key == Lv)
|
| | | {
|
| | | List<AwardItem> fairyJadeInvestmentItem = Dit[key].FairyJadeInvestmentItem.GetAwardItem(grade);
|
| | | AwardItem item = fairyJadeInvestmentItem[0];
|
| | | GetFairyJade = item.item.count;
|
| | | List<Item> fairyJadeInvestmentItem = Dit[key].FairyJadeInvestmentItem.GetAwardItem(grade);
|
| | | Item item = fairyJadeInvestmentItem[0];
|
| | | GetFairyJade = item.count;
|
| | | }
|
| | | }
|
| | | return GetFairyJade;
|
| | |
| | | {
|
| | | if (key <= lv)
|
| | | {
|
| | | List<AwardItem> fairyJadeInvestmentItem = Dit[key].FairyJadeInvestmentItem.GetAwardItem(grade);
|
| | | AwardItem item = fairyJadeInvestmentItem[0];
|
| | | GetFairyJade += item.item.count;
|
| | | List<Item> fairyJadeInvestmentItem = Dit[key].FairyJadeInvestmentItem.GetAwardItem(grade);
|
| | | Item item = fairyJadeInvestmentItem[0];
|
| | | GetFairyJade += item.count;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[key].ToJson());
|
| | | for (int j = 0; j < _itemArray.Length; j++)
|
| | | {
|
| | | FairyJadeItem.Add(_job, new AwardItem()
|
| | | {
|
| | | item = new Item(_itemArray[j][0], _itemArray[j][1]),
|
| | | isBind = _itemArray[j][2],
|
| | | });
|
| | | FairyJadeItem.Add(_job, new Item(_itemArray[j][0], _itemArray[j][1]));
|
| | | }
|
| | | }
|
| | | fairyJadeInvestment.FairyJadeInvestmentItem = FairyJadeItem;
|
| | |
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[key].ToJson());
|
| | | for (int j = 0; j < _itemArray.Length; j++)
|
| | | {
|
| | | FairyJadeItem.Add(_job, new AwardItem()
|
| | | {
|
| | | item = new Item(_itemArray[j][0], _itemArray[j][1]),
|
| | | isBind = _itemArray[j][2],
|
| | | });
|
| | | FairyJadeItem.Add(_job, new Item(_itemArray[j][0], _itemArray[j][1]));
|
| | | }
|
| | | }
|
| | | fairyJadeInvestment.FairyJadeInvestmentItem = FairyJadeItem;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | List<AwardItem> fairyJadeInvestmentItem = Dit[key].FairyJadeInvestmentItem.GetAwardItem(InvestmentGrade);
|
| | | List<Item> fairyJadeInvestmentItem = Dit[key].FairyJadeInvestmentItem.GetAwardItem(InvestmentGrade);
|
| | | int AtPresentNumber = 0;
|
| | | if (IsReceive != 0)
|
| | | {
|
| | | List<AwardItem> fairyJadeInvestmentItemAdd = Dit[key].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
|
| | | AwardItem itemAdd = fairyJadeInvestmentItemAdd[0];
|
| | | AtPresentNumber = itemAdd.item.count;
|
| | | List<Item> fairyJadeInvestmentItemAdd = Dit[key].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
|
| | | Item itemAdd = fairyJadeInvestmentItemAdd[0];
|
| | | AtPresentNumber = itemAdd.count;
|
| | | }
|
| | | if (fairyJadeInvestmentItem[0].item.count > AtPresentNumber)
|
| | | if (fairyJadeInvestmentItem[0].count > AtPresentNumber)
|
| | | {
|
| | | redPointStre1.state = RedPointState.GetReward;
|
| | | JumpInedx = type;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | List<AwardItem> fairyJadeInvestmentItem = dit[key].FairyJadeInvestmentItem.GetAwardItem(typeGrade);
|
| | | List<Item> fairyJadeInvestmentItem = dit[key].FairyJadeInvestmentItem.GetAwardItem(typeGrade);
|
| | | int AtPresentNumber = 0;
|
| | | if (IsReceive != 0)
|
| | | {
|
| | | List<AwardItem> fairyJadeInvestmentItemAdd = dit[key].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
|
| | | AwardItem itemAdd = fairyJadeInvestmentItemAdd[0];
|
| | | AtPresentNumber = itemAdd.item.count;
|
| | | List<Item> fairyJadeInvestmentItemAdd = dit[key].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
|
| | | Item itemAdd = fairyJadeInvestmentItemAdd[0];
|
| | | AtPresentNumber = itemAdd.count;
|
| | | }
|
| | | if (fairyJadeInvestmentItem[0].item.count > AtPresentNumber)
|
| | | if (fairyJadeInvestmentItem[0].count > AtPresentNumber)
|
| | | {
|
| | | Isbool3 = true;
|
| | | }
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | List<AwardItem> fairyJadeInvestmentItem = dit[key].FairyJadeInvestmentItem.GetAwardItem(typeGrade);
|
| | | List<Item> fairyJadeInvestmentItem = dit[key].FairyJadeInvestmentItem.GetAwardItem(typeGrade);
|
| | | int AtPresentNumber = 0;
|
| | | if (IsReceive != 0)
|
| | | {
|
| | | List<AwardItem> fairyJadeInvestmentItemAdd = dit[key].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
|
| | | AwardItem itemAdd = fairyJadeInvestmentItemAdd[0];
|
| | | AtPresentNumber = itemAdd.item.count;
|
| | | List<Item> fairyJadeInvestmentItemAdd = dit[key].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
|
| | | Item itemAdd = fairyJadeInvestmentItemAdd[0];
|
| | | AtPresentNumber = itemAdd.count;
|
| | | }
|
| | | if (fairyJadeInvestmentItem[0].item.count > AtPresentNumber)
|
| | | if (fairyJadeInvestmentItem[0].count > AtPresentNumber)
|
| | | {
|
| | | Isbool4 = true;
|
| | | }
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | List<AwardItem> fairyJadeInvestmentItem = dit[key].FairyJadeInvestmentItem.GetAwardItem(typeGrade);
|
| | | List<Item> fairyJadeInvestmentItem = dit[key].FairyJadeInvestmentItem.GetAwardItem(typeGrade);
|
| | | int AtPresentNumber = 0;
|
| | | if (IsReceive != 0)
|
| | | {
|
| | | List<AwardItem> fairyJadeInvestmentItemAdd = dit[key].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
|
| | | AwardItem itemAdd = fairyJadeInvestmentItemAdd[0];
|
| | | AtPresentNumber = itemAdd.item.count;
|
| | | List<Item> fairyJadeInvestmentItemAdd = dit[key].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
|
| | | Item itemAdd = fairyJadeInvestmentItemAdd[0];
|
| | | AtPresentNumber = itemAdd.count;
|
| | | }
|
| | | if (fairyJadeInvestmentItem[0].item.count > AtPresentNumber)
|
| | | if (fairyJadeInvestmentItem[0].count > AtPresentNumber)
|
| | | {
|
| | | Isbool5 = true;
|
| | | }
|
| | |
| | |
|
| | | private void UpdateItems()
|
| | | {
|
| | | List<AwardItem> _list = null;
|
| | | List<Item> _list = null;
|
| | | model.TryGetFirstReward(PlayerDatas.Instance.baseData.Job, out _list);
|
| | | if (_list != null)
|
| | | {
|
| | |
| | | }
|
| | | m_Items[i].gameObject.SetActive(true);
|
| | | var _item = _list[i];
|
| | | var _itemModel = new ItemCellModel(_item.item.id, false, (ulong)_item.item.count, _item.isBind);
|
| | | var _itemModel = new ItemCellModel(_item.id, false, (ulong)_item.count);
|
| | | m_Items[i].Init(_itemModel);
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | private void OnItemClick(int _index)
|
| | | {
|
| | | List<AwardItem> _list = null;
|
| | | List<Item> _list = null;
|
| | | model.TryGetFirstReward(PlayerDatas.Instance.baseData.Job, out _list);
|
| | | if (_list != null)
|
| | | {
|
| | | if (_index < _list.Count)
|
| | | {
|
| | | var item = _list[_index];
|
| | | ItemAttrData attrData = new ItemAttrData(item.item.id, true, (ulong)item.item.count, -1, item.isBind, true);
|
| | | ItemAttrData attrData = new ItemAttrData(item.id, true, (ulong)item.count, -1, 0, true);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(attrData);
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | m_Text_NeedMoeny.text = NeedForWhite.NeedMoney.ToString();
|
| | | var Job = PlayerDatas.Instance.baseData.Job;
|
| | | List<AwardItem> NeedForWhiteItem = NeedForWhite.AwardItem.GetAwardItem(Job);
|
| | | List<Item> NeedForWhiteItem = NeedForWhite.AwardItem.GetAwardItem(Job);
|
| | | m_ItemCell_One.gameObject.SetActive(false);
|
| | | m_ItemCell_Two.gameObject.SetActive(false);
|
| | | m_ItemCell_Three.gameObject.SetActive(false);
|
| | | for (int i = 0; i < NeedForWhiteItem.Count; i++)
|
| | | {
|
| | | int Type = i;
|
| | | AwardItem item = NeedForWhiteItem[i];
|
| | | var Item = ItemConfig.Get(item.item.id);
|
| | | ItemCellModel cellModel = new ItemCellModel(item.item.id, true, (ulong)item.item.count, item.isBind);
|
| | | Item item = NeedForWhiteItem[i];
|
| | | var Item = ItemConfig.Get(item.id);
|
| | | ItemCellModel cellModel = new ItemCellModel(item.id, true, (ulong)item.count);
|
| | | switch (Type)
|
| | | {
|
| | | case 0:
|
| | |
| | | m_ItemCell_One.cellBtn.RemoveAllListeners();
|
| | | m_ItemCell_One.cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(item.item.id, false, (ulong)item.item.count, -1, item.isBind);
|
| | | ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count, -1);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | break;
|
| | |
| | | m_ItemCell_Two.cellBtn.RemoveAllListeners();
|
| | | m_ItemCell_Two.cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(item.item.id, false, (ulong)item.item.count, -1, item.isBind);
|
| | | ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count, -1);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | break;
|
| | |
| | | m_ItemCell_Three.cellBtn.RemoveAllListeners();
|
| | | m_ItemCell_Three.cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(item.item.id, false, (ulong)item.item.count, -1, item.isBind);
|
| | | ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count, -1);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | break;
|
| | |
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[key].ToJson());
|
| | | for (int j = 0; j < _itemArray.Length; j++)
|
| | | {
|
| | | awardItem.Add(_job, new AwardItem()
|
| | | {
|
| | | item = new Item(_itemArray[j][0], _itemArray[j][1]),
|
| | | isBind = _itemArray[j][2],
|
| | | });
|
| | | awardItem.Add(_job, new Item(_itemArray[j][0], _itemArray[j][1]));
|
| | | }
|
| | | }
|
| | | NeedForWhite.AwardItem = awardItem;
|
| | |
| | |
|
| | | public class NeedForWhiteItem
|
| | | {
|
| | | private Dictionary<int, List<AwardItem>> m_AwardDict = new Dictionary<int, List<AwardItem>>();
|
| | | private Dictionary<int, List<Item>> m_AwardDict = new Dictionary<int, List<Item>>();
|
| | |
|
| | | public List<AwardItem> GetAwardItem(int _job)
|
| | | public List<Item> GetAwardItem(int _job)
|
| | | {
|
| | | List<AwardItem> _items = null;
|
| | | List<Item> _items = null;
|
| | | m_AwardDict.TryGetValue(_job, out _items);
|
| | | return _items;
|
| | | }
|
| | | public void Add(int _job, AwardItem _item)
|
| | | public void Add(int _job, Item _item)
|
| | | {
|
| | | List<AwardItem> _list = null;
|
| | | List<Item> _list = null;
|
| | | if (!m_AwardDict.TryGetValue(_job, out _list))
|
| | | {
|
| | | _list = new List<AwardItem>();
|
| | | _list = new List<Item>();
|
| | | m_AwardDict.Add(_job, _list);
|
| | | }
|
| | | _list.Add(_item);
|
| | |
| | | }
|
| | | m_Items[i].gameObject.SetActive(true);
|
| | | var _item = _list[i];
|
| | | var _itemModel = new ItemCellModel(_item.item.id, false, (ulong)_item.item.count, _item.isBind);
|
| | | var _itemModel = new ItemCellModel(_item.id, false, (ulong)_item.count);
|
| | | m_Items[i].SetItemRare(_itemModel, 4);
|
| | | }
|
| | | }
|
| | |
| | | if (index < _list.Count)
|
| | | {
|
| | | var item = _list[index];
|
| | | ItemAttrData attrData = new ItemAttrData(item.item.id, false, (ulong)item.item.count, -1, item.isBind);
|
| | | ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count, -1);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(attrData);
|
| | | }
|
| | | }
|
| | |
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[_key].ToJson());
|
| | | for (int j = 0; j < _itemArray.Length; j++)
|
| | | {
|
| | | _item.Add(_job, new AwardItem()
|
| | | {
|
| | | item = new Item(_itemArray[j][0], _itemArray[j][1]),
|
| | | isBind = _itemArray[j][2],
|
| | | });
|
| | | _item.Add(_job, new Item(_itemArray[j][0], _itemArray[j][1]));
|
| | | }
|
| | | }
|
| | | data.giftItems = _item;
|
| | |
| | | private void ParseCTGConfig()
|
| | | {
|
| | | var configs = OrderInfoConfig.GetValues();
|
| | | m_RechargeGainItemDict = new Dictionary<int, List<AwardItem>>();
|
| | | m_RechargeGainItemDict = new Dictionary<int, List<Item>>();
|
| | | for (int i = 0; i < configs.Count; i++)
|
| | | {
|
| | | List<OrderInfoConfig> list;
|
| | |
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(ctg.GainItemList);
|
| | | if (_itemArray != null && _itemArray.Length > 0)
|
| | | {
|
| | | var _itemList = new List<AwardItem>();
|
| | | var _itemList = new List<Item>();
|
| | | m_RechargeGainItemDict.Add(configs[i].CTGID, _itemList);
|
| | | for (int k = 0; k < _itemArray.Length; k++)
|
| | | {
|
| | | AwardItem _item = new AwardItem()
|
| | | {
|
| | | item = new Item()
|
| | | {
|
| | | id = _itemArray[k][0],
|
| | | count = _itemArray[k][1],
|
| | | },
|
| | | isBind = _itemArray[k][2],
|
| | | };
|
| | | Item _item = new Item(_itemArray[k][0], _itemArray[k][1]);
|
| | | _itemList.Add(_item);
|
| | | }
|
| | | }
|
| | |
| | | return m_CTGConfigDict.Values.Last();
|
| | | }
|
| | |
|
| | | public bool TryGetRechargeItem(int id, out List<AwardItem> list)
|
| | | public bool TryGetRechargeItem(int id, out List<Item> list)
|
| | | {
|
| | | return m_RechargeGainItemDict.TryGetValue(id, out list);
|
| | | }
|
| | |
|
| | | private Dictionary<int, List<AwardItem>> m_FirstChargeItemDict = new Dictionary<int, List<AwardItem>>();
|
| | | private Dictionary<int, List<Item>> m_FirstChargeItemDict = new Dictionary<int, List<Item>>();
|
| | | private Dictionary<int, int> m_FirstChargeWorthDict = new Dictionary<int, int>();
|
| | | private void ParseFirstCharge()
|
| | | {
|
| | |
| | | foreach (var _key in _itemJson.Keys)
|
| | | {
|
| | | var _job = int.Parse(_key);
|
| | | List<AwardItem> _list = null;
|
| | | List<Item> _list = null;
|
| | | if (!m_FirstChargeItemDict.TryGetValue(_job, out _list))
|
| | | {
|
| | | _list = new List<AwardItem>();
|
| | | _list = new List<Item>();
|
| | | m_FirstChargeItemDict.Add(_job, _list);
|
| | | }
|
| | | m_FirstChargeWorthDict.Add(_job, int.Parse(_worthJson[_key].ToJson()));
|
| | | var _itemArray = JsonMapper.ToObject<int[][]>(_itemJson[_key].ToJson());
|
| | | for (int i = 0; i < _itemArray.Length; i++)
|
| | | {
|
| | | AwardItem _item = new AwardItem()
|
| | | {
|
| | | item = new Item()
|
| | | {
|
| | | id = _itemArray[i][0],
|
| | | count = _itemArray[i][1],
|
| | | },
|
| | | isBind = _itemArray[i][2],
|
| | | };
|
| | | Item _item = new Item(_itemArray[i][0], _itemArray[i][1]);
|
| | | _list.Add(_item);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetFirstReward(int _job, out List<AwardItem> _list)
|
| | | public bool TryGetFirstReward(int _job, out List<Item> _list)
|
| | | {
|
| | | return m_FirstChargeItemDict.TryGetValue(_job, out _list);
|
| | | }
|
| | |
| | |
|
| | | #region 充值
|
| | | public Dictionary<int, int> firstRechargeWeapon { get; private set; }
|
| | | public Dictionary<int, List<AwardItem>> m_RechargeGainItemDict { get; private set; }
|
| | | public Dictionary<int, List<Item>> m_RechargeGainItemDict { get; private set; }
|
| | | private Dictionary<int, RechargeCount> m_RechargeCountDict = new Dictionary<int, RechargeCount>();
|
| | | Dictionary<string, List<OrderInfoConfig>> m_OrderInfoDict = new Dictionary<string, List<OrderInfoConfig>>();
|
| | | public int presentSelectRechargeId { get; private set; }
|
| | |
| | | {
|
| | | if (index < m_Items.Length)
|
| | | {
|
| | | ItemCellModel cellModel = new ItemCellModel(award.item.id, false, (ulong)award.item.count, award.isBind);
|
| | | ItemCellModel cellModel = new ItemCellModel(award.id, false, (ulong)award.count);
|
| | | m_Items[index].Init(cellModel);
|
| | | m_Items[index].cellBtn.RemoveAllListeners();
|
| | | m_Items[index].cellBtn.AddListener(() =>
|
| | | {
|
| | | TreasureEffectModel effectModel = ModelCenter.Instance.GetModel<TreasureEffectModel>();
|
| | | ItemConfig itemConfig = ItemConfig.Get(award.item.id);
|
| | | ItemConfig itemConfig = ItemConfig.Get(award.id);
|
| | | if(itemConfig.Effect1 == 232)
|
| | | {
|
| | | effectModel.SetTreasureID(itemConfig.EffectValueA1, model.presentSelectVip);
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(award.item.id, false, (ulong)award.item.count, -1, award.isBind);
|
| | | ItemAttrData attrData = new ItemAttrData(award.id, false, (ulong)award.count, -1);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | | }
|
| | | });
|
| | |
| | | var _array = LitJson.JsonMapper.ToObject<int[][]>(_json[_key].ToJson());
|
| | | for (int j = 0; j < _array.Length; j++)
|
| | | {
|
| | | _award.Add(_job, new AwardItem()
|
| | | {
|
| | | item = new Item(_array[j][0], _array[j][1]),
|
| | | isBind = 1,
|
| | | });
|
| | | _award.Add(_job, new Item(_array[j][0], _array[j][1]));
|
| | | }
|
| | | }
|
| | | levelGiftItemDict.Add(_cfgs[i].RewardID, _award);
|
| | |
| | | var intarray = LitJson.JsonMapper.ToObject<int[][]>(_cfgs[i].VIPAward);
|
| | | VIPAward vipAward = new VIPAward()
|
| | | {
|
| | | item = new AwardItem()
|
| | | {
|
| | | item = new Item()
|
| | | {
|
| | | id = intarray[0][0],
|
| | | count = intarray[0][1],
|
| | | },
|
| | | isBind = 0,
|
| | | },
|
| | | item = new Item(intarray[0][0], intarray[0][1]),
|
| | | vipLv = _cfgs[i].VIPLimit,
|
| | | };
|
| | | m_VipItemDict.Add(_cfgs[i].RewardID, vipAward);
|
| | |
| | | }
|
| | | return (vipGiftGetRecord & (1 << _index)) != 0;
|
| | | }
|
| | |
|
| | | //private Dictionary<int, int> limitGiftCntDict = new Dictionary<int, int>();
|
| | | //public event Action OnLimitGiftUpdateEvent;
|
| | | //private void onGetUniversalGameInfo(HA003_tagUniversalGameRecInfo _package)
|
| | | //{
|
| | | // if (_package.Type == 3)
|
| | | // {
|
| | | // for (int i = 0; i < _package.Count; i++)
|
| | | // {
|
| | | // var _data = _package.UniversalGameRec[i];
|
| | | // //limitGiftCntDict[(int)_data.Value1] = (int)_data.Value2;
|
| | | // }
|
| | | // UpdateRedpoint();
|
| | | // if (OnLimitGiftUpdateEvent != null)
|
| | | // {
|
| | | // OnLimitGiftUpdateEvent();
|
| | | // }
|
| | | // }
|
| | | //}
|
| | |
|
| | | //public int LimitGiftGetCount(int _id)
|
| | | //{
|
| | | // if (limitGiftCntDict.ContainsKey(_id))
|
| | | // {
|
| | | // return limitGiftCntDict[_id];
|
| | | // }
|
| | | // return 0;
|
| | | //}
|
| | |
|
| | | public void TryGetLevelGift(out int _index)
|
| | | {
|
| | |
| | |
|
| | | public struct VIPAward
|
| | | {
|
| | | public AwardItem item;
|
| | | public Item item;
|
| | | public int vipLv;
|
| | | }
|
| | | }
|
| | |
| | | _cell.items[i].gameObject.SetActive(true);
|
| | | _cell.gotImages[i].gameObject.SetActive(_isGet);
|
| | | var _item = _items[i];
|
| | | ItemCellModel _ItemData = new ItemCellModel(_item.item.id, false, (ulong)_item.item.count, _item.isBind);
|
| | | ItemCellModel _ItemData = new ItemCellModel(_item.id, false, (ulong)_item.count);
|
| | | _cell.items[i].Init(_ItemData);
|
| | | _cell.items[i].cellBtn.RemoveAllListeners();
|
| | | _cell.items[i].cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData _itemPropertyData = new ItemAttrData(_item.item.id, false, (ulong)_item.item.count, -1, _item.isBind);
|
| | | ItemAttrData _itemPropertyData = new ItemAttrData(_item.id, false, (ulong)_item.count, -1);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(_itemPropertyData);
|
| | | });
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | var _vipAward = model.m_VipItemDict[_cell.index];
|
| | | ItemCellModel _vipDate = new ItemCellModel(_vipAward.item.item.id, false, (ulong)_vipAward.item.item.count, _vipAward.item.isBind);
|
| | | ItemCellModel _vipDate = new ItemCellModel(_vipAward.item.id, false, (ulong)_vipAward.item.count);
|
| | | _cell.vipItem.Init(_vipDate);
|
| | | _cell.vipItem.cellBtn.RemoveAllListeners();
|
| | | _cell.vipItem.cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData _itemPropertyData = new ItemAttrData(_vipAward.item.item.id, false, (ulong)_vipAward.item.item.count, -1, _vipAward.item.isBind);
|
| | | ItemAttrData _itemPropertyData = new ItemAttrData(_vipAward.item.id, false, (ulong)_vipAward.item.count, -1);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(_itemPropertyData);
|
| | | });
|
| | | _cell.vipGotImage.gameObject.SetActive(_vipGot);
|