Merge remote-tracking branch 'origin/master' into Skill_Polymorph_BeatBackPlayer
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Monday, August 20, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using UnityEngine;
|
| | | using System;
|
| | |
|
| | | namespace TableConfig {
|
| | |
|
| | | |
| | | public partial class TrialRewardsConfig : ConfigBase {
|
| | |
|
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Tuesday, August 21, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | namespace TableConfig { |
| | | |
| | | |
| | | public partial class TrialRewardsConfig : ConfigBase { |
| | | |
| | | public int id { get ; private set ; }
|
| | | public int lineId { get ; private set ; }
|
| | | public int grade { get ; private set ; }
|
| | | public int[] rewards;
|
| | |
|
| | | public override string getKey()
|
| | | {
|
| | | return id.ToString();
|
| | | }
|
| | |
|
| | | public override void Parse() {
|
| | | try
|
| | | {
|
| | | public string rewards { get ; private set; } |
| | | |
| | | public override string getKey() |
| | | { |
| | | return id.ToString(); |
| | | } |
| | | |
| | | public override void Parse() { |
| | | try |
| | | { |
| | | id=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
|
| | |
|
| | | lineId=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
|
| | |
|
| | | grade=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0;
|
| | |
|
| | | string[] rewardsStringArray = rawContents[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | rewards = new int[rewardsStringArray.Length]; |
| | | for (int i=0;i<rewardsStringArray.Length;i++) |
| | | { |
| | | int.TryParse(rewardsStringArray[i],out rewards[i]); |
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | rewards = rawContents[3].Trim(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ee2212e198950744b9c7524b9d74d042 |
| | | timeCreated: 1534748051 |
| | | timeCreated: 1534819587 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | }
|
| | | else
|
| | | {
|
| | | path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, "config/", fileName, ".bytes");
|
| | | path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, "config/", fileName, ".txt");
|
| | | }
|
| | |
|
| | | var task = new ConfigTask(typeof(T), AssetSource.refdataFromEditor ? AssetPath.ResourceOut : AssetPath.External, path);
|
| | |
| | | (object _obj) =>
|
| | | {
|
| | | string[] lines = null;
|
| | | StreamReader sr = null;
|
| | |
|
| | | try
|
| | | {
|
| | | if (_task.assetPath == AssetPath.ResourceOut)
|
| | | {
|
| | | lines = File.ReadAllLines(_task.filePath, Encoding.UTF8);
|
| | | }
|
| | | else if (_task.assetPath == AssetPath.External)
|
| | | {
|
| | | var tripleDESCryptoServiceProvider = new TripleDESCryptoServiceProvider();
|
| | | tripleDESCryptoServiceProvider.Key = Convert.FromBase64String(CustomKey);
|
| | | tripleDESCryptoServiceProvider.IV = Convert.FromBase64String(CustomIV);
|
| | | tripleDESCryptoServiceProvider.Mode = CipherMode.CBC;
|
| | | tripleDESCryptoServiceProvider.Padding = PaddingMode.PKCS7;
|
| | | var decryptor = tripleDESCryptoServiceProvider.CreateDecryptor();
|
| | |
|
| | | var expectedSteam = new FileStream(_task.filePath, FileMode.Open, FileAccess.Read, FileShare.Read);
|
| | | var bytes = new byte[expectedSteam.Length];
|
| | | expectedSteam.Read(bytes, 0, bytes.Length);
|
| | | var tableMs = new MemoryStream(bytes);
|
| | |
|
| | | var crypS = new CryptoStream(tableMs, decryptor, CryptoStreamMode.Read);
|
| | | sr = new StreamReader(crypS, Encoding.UTF8);
|
| | | var content = sr.ReadToEnd();
|
| | |
|
| | | lines = content.Split(new string[] { "\r\n" }, StringSplitOptions.None);
|
| | | }
|
| | |
|
| | | lines = File.ReadAllLines(_task.filePath, Encoding.UTF8);
|
| | | _task.state = TaskState.ReadFileSuccess;
|
| | | }
|
| | | catch (Exception ex)
|
| | |
| | | return modellist;
|
| | | }
|
| | |
|
| | | public int GetTicketId(int firstType, int secondType, int thirdType)
|
| | | {
|
| | | var itemId = 0;
|
| | | var dict = ItemCompoundConfig.GetFirstComposeTypeDict(firstType);
|
| | | Dictionary<int, List<ItemCompoundConfig>> _secondTypeDict = null;
|
| | | dict.TryGetValue(secondType, out _secondTypeDict);
|
| | | if (_secondTypeDict != null)
|
| | | {
|
| | | List<ItemCompoundConfig> modellist = null;
|
| | | _secondTypeDict.TryGetValue(thirdType, out modellist);
|
| | | if (modellist != null && modellist.Count > 0)
|
| | | {
|
| | | int.TryParse(modellist[0].makeID, out itemId);
|
| | | }
|
| | | }
|
| | | return itemId;
|
| | | }
|
| | |
|
| | | public int[] makeIDs { get; private set; }
|
| | | public int[] unfixedItemIDs { get; private set; }
|
| | | public int[] costfixedItemIDs { get; private set; }
|
| | |
| | | {
|
| | | bool isEnough = true;
|
| | | Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>> getFirstModel = ItemCompoundConfig.GetFirstComposeTypeDict((int)ComposeFuncType.Ticket);
|
| | | if(getFirstModel.ContainsKey(secondType))
|
| | | if (getFirstModel.ContainsKey(secondType))
|
| | | {
|
| | | if(getFirstModel[secondType].ContainsKey(0))
|
| | | if (getFirstModel[secondType].ContainsKey(0))
|
| | | {
|
| | | ItemCompoundConfig compoundConfig = getFirstModel[secondType][0][0];
|
| | | int[] fixedIDs = ConfigParse.GetMultipleStr<int>(compoundConfig.itemID);
|
| | | int[] fixedCnt = ConfigParse.GetMultipleStr<int>(compoundConfig.itemCount);
|
| | | for(int i= 0; i< fixedIDs.Length; i++)
|
| | | for (int i = 0; i < fixedIDs.Length; i++)
|
| | | {
|
| | | int haveCnt = playerPack.GetItemCountByID(PackType.rptItem,fixedIDs[i]);
|
| | | if(fixedCnt[i] > haveCnt)
|
| | | int haveCnt = playerPack.GetItemCountByID(PackType.rptItem, fixedIDs[i]);
|
| | | if (fixedCnt[i] > haveCnt)
|
| | | {
|
| | | isEnough = false;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | isEnough = false;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | isEnough = false;
|
| | | }
|
| | | return isEnough;
|
| | | }
|
| | |
|
| | | #region 处理跳转界面数据
|
| | | #region 处理跳转界面数据
|
| | |
|
| | | public bool CheckComposeItemById(int itemId)
|
| | | {
|
| | |
| | | ConfirmCancel.ShowItemConfirm(string.Format("消耗{0}X{1}永久增加1个助战神兽", _itemConfig.ItemName, model.GetAssistItemCnt()),
|
| | | model.AddAssistItem, model.GetAssistItemCnt(), () =>
|
| | | {
|
| | |
|
| | | model.SendBuyAssistCnt();
|
| | | });
|
| | | }
|
| | | private void TakeOffEquip()
|
| | | {
|
| | | model.SendPutOffEquip(0);
|
| | | }
|
| | | private void OpenEquipPack()
|
| | | {
|
| | |
| | | }
|
| | | private void CallBackDogz()
|
| | | {
|
| | | List<ItemModel> models = model.GetDogzEquips(model.presentSelectDogz);
|
| | | if(models != null
|
| | | && models.Count == 5)
|
| | | {
|
| | | if(!model.TryGetAssistDogzState(model.presentSelectDogz))
|
| | | {
|
| | | model.SendChangeDogzAssist(1);
|
| | | }
|
| | | else
|
| | | {
|
| | | model.SendChangeDogzAssist(0);
|
| | | }
|
| | | |
| | | }
|
| | | }
|
| | | private void OpenDogzEquip(int index)
|
| | | {
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public void SendPutOnEquip(int dogzId,int index)
|
| | | public void SendPutOnEquip(int index)
|
| | | {
|
| | | CA5C0_tagCMDogzEquipItem dogzPutOn = new CA5C0_tagCMDogzEquipItem();
|
| | | dogzPutOn.DogzID = (byte)dogzId;
|
| | | dogzPutOn.DogzID = (byte)presentSelectDogz;
|
| | | dogzPutOn.EquipIndex = (byte)index;
|
| | | GameNetSystem.Instance.SendInfo(dogzPutOn);
|
| | | }
|
| | |
|
| | | public void SendPutOffEquip(int dogzId, int equipPlace)
|
| | | public void SendPutOffEquip(int equipPlace)
|
| | | {
|
| | | CA5C1_tagCMDogzUnEquipItem dogzPutOff = new CA5C1_tagCMDogzUnEquipItem();
|
| | | dogzPutOff.DogzID = (byte)dogzId;
|
| | | dogzPutOff.DogzID = (byte)presentSelectDogz;
|
| | | dogzPutOff.EquipPlace = (byte)equipPlace;
|
| | | GameNetSystem.Instance.SendInfo(dogzPutOff);
|
| | | }
|
| | |
|
| | | public void SendChangeDogzAssist(int dogzId, int assistState)
|
| | | public void SendChangeDogzAssist(int assistState)
|
| | | {
|
| | | CA5C2_tagCMDogzBattleStateChange stateChange = new CA5C2_tagCMDogzBattleStateChange();
|
| | | stateChange.DogzID = (byte)dogzId;
|
| | | stateChange.DogzID = (byte)presentSelectDogz;
|
| | | stateChange.BatteState = (byte)assistState;
|
| | | GameNetSystem.Instance.SendInfo(stateChange);
|
| | | }
|
| | |
| | | { |
| | | CloseChild(); |
| | | functionOrder = 1; |
| | | WindowCenter.Instance.Open<DogzStrengthenWin>(); |
| | | WindowCenter.Instance.Open<GodBeastReinforcementWin>(); |
| | | } |
| | | |
| | | private void OnDogz() |
| | |
| | | { |
| | | WindowCenter.Instance.CloseImmediately<DogzActiveWin>(); |
| | | } |
| | | if (WindowCenter.Instance.CheckOpen<DogzStrengthenWin>()) |
| | | if (WindowCenter.Instance.CheckOpen<GodBeastReinforcementWin>()) |
| | | { |
| | | WindowCenter.Instance.CloseImmediately<DogzStrengthenWin>(); |
| | | WindowCenter.Instance.CloseImmediately<GodBeastReinforcementWin>(); |
| | | } |
| | | } |
| | | } |
| | |
| | | var rankKey = UIHelper.GetIntervalAward(fairyLeagueModel.integralRankAwardDict.Keys, _index + 1);
|
| | | if (rankKey != -1)
|
| | | {
|
| | | var _awardItem = fairyLeagueModel.integralRankAwardDict[rankKey][0];
|
| | | var _per = fairyLeagueModel.integralRankAwardPer[fairyLeagueModel.fairyLeagueGroupId - 1];
|
| | | var _count = (int)Mathf.Max(_awardItem.item.count * ((float)_per / 100), 1);
|
| | | m_AwardItem.Init(_awardItem.item.id, _count, _awardItem.isBind);
|
| | | var _item = fairyLeagueModel.integralRankAwardDict[rankKey][0];
|
| | | var _per = 100;
|
| | | if ((fairyLeagueModel.fairyLeagueGroupId - 1) >= 0
|
| | | && (fairyLeagueModel.fairyLeagueGroupId - 1) < fairyLeagueModel.integralRankAwardPer.Length)
|
| | | {
|
| | | _per = fairyLeagueModel.integralRankAwardPer[fairyLeagueModel.fairyLeagueGroupId - 1];
|
| | | }
|
| | | var _count = (int)Mathf.Max(_item.count * (_item.isPer == 1 ? ((float)_per / 100) : 1), 1);
|
| | | m_AwardItem.Init(_item.id, _count, _item.bind);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return _maxCnt;
|
| | | }
|
| | |
|
| | | public Item GetLackItem(DungeonSuppliesLackWin.LackType lackType)
|
| | | {
|
| | | switch (lackType)
|
| | | {
|
| | | case DungeonSuppliesLackWin.LackType.PersonalBoss:
|
| | | return GetDungeonTicketCost(PersonalBossModel.PERSONALBOSS_MAPID);
|
| | | case DungeonSuppliesLackWin.LackType.ElderGodArea:
|
| | | return GetDungeonTicketCost(ElderGodAreaModel.ELDERGODAREA_MAPID);
|
| | | case DungeonSuppliesLackWin.LackType.Kylin:
|
| | | return GetSweepCost(selectedKylinDungeon);
|
| | | case DungeonSuppliesLackWin.LackType.IceCrystal:
|
| | | return GetSweepCost(new Dungeon(31140, 0));
|
| | | case DungeonSuppliesLackWin.LackType.FairyLand:
|
| | | return GetDungeonTicketCost(31080);
|
| | | case DungeonSuppliesLackWin.LackType.SingleIceCrystal:
|
| | | return GetDungeonTicketCost(31140);
|
| | | default:
|
| | | return default(Item);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsElderGodExpel()
|
| | | {
|
| | | var dataMapId = GetDungeonDataIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | |
| | |
|
| | | private Item GetLackItem(LackType _lackType)
|
| | | {
|
| | | switch (_lackType)
|
| | | {
|
| | | case LackType.PersonalBoss:
|
| | | return dungeonModel.GetDungeonTicketCost(PersonalBossModel.PERSONALBOSS_MAPID);
|
| | | case LackType.ElderGodArea:
|
| | | return dungeonModel.GetDungeonTicketCost(ElderGodAreaModel.ELDERGODAREA_MAPID);
|
| | | case LackType.Kylin:
|
| | | return dungeonModel.GetSweepCost(dungeonModel.selectedKylinDungeon);
|
| | | case LackType.IceCrystal:
|
| | | return dungeonModel.GetSweepCost(new Dungeon(31140, 0));
|
| | | case LackType.FairyLand:
|
| | | return dungeonModel.GetDungeonTicketCost(31080);
|
| | | case LackType.SingleIceCrystal:
|
| | | return dungeonModel.GetDungeonTicketCost(31140);
|
| | | default:
|
| | | return default(Item);
|
| | | }
|
| | | return dungeonModel.GetLackItem(_lackType);
|
| | | }
|
| | |
|
| | | private int GetUnitPrice(LackType _lackType)
|
| | |
| | | for (int i = 0; i < m_RewardBehaviours.Length; i++)
|
| | | {
|
| | | var behaviour = m_RewardBehaviours[i];
|
| | | int[] rewards = null;
|
| | | Item[] rewards = null;
|
| | | if (trialDungeonModel.TryGetTrialRewards(config.LineID, m_RewardBehaviours[i].grade, out rewards))
|
| | | {
|
| | | behaviour.gameObject.SetActive(true);
|
| | |
| | | {
|
| | | Dictionary<int, List<TrialExchangeConfig>> trialTokenExchangeDict = new Dictionary<int, List<TrialExchangeConfig>>();
|
| | | Dictionary<int, int> lineToTokenClassDict;
|
| | | Dictionary<int, Dictionary<int, int[]>> trialRewardDict = new Dictionary<int, Dictionary<int, int[]>>();
|
| | | Dictionary<int, Dictionary<int, Item[]>> trialRewardDict = new Dictionary<int, Dictionary<int, Item[]>>();
|
| | | public Dictionary<int, List<int>> trialClassTokens = new Dictionary<int, List<int>>();
|
| | | public List<int> trialTokens = new List<int>();
|
| | | PlayerPackModel packModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
| | | var trialRewards = ConfigManager.Instance.GetAllValues<TrialRewardsConfig>();
|
| | | for (int i = 0; i < trialRewards.Count; i++)
|
| | | {
|
| | | Dictionary<int, int[]> dict = null;
|
| | | Dictionary<int, Item[]> dict = null;
|
| | | if (!trialRewardDict.TryGetValue(trialRewards[i].lineId, out dict))
|
| | | {
|
| | | dict = new Dictionary<int, int[]>();
|
| | | dict = new Dictionary<int, Item[]>();
|
| | | trialRewardDict.Add(trialRewards[i].lineId, dict);
|
| | | }
|
| | | dict.Add(trialRewards[i].grade, trialRewards[i].rewards);
|
| | | var itemsArray = LitJson.JsonMapper.ToObject<int[][]>(trialRewards[i].rewards);
|
| | | if (itemsArray != null && itemsArray.Length > 0)
|
| | | {
|
| | | Item[] items = new Item[itemsArray.Length];
|
| | | for (int k = 0; k < itemsArray.Length; k++)
|
| | | {
|
| | | items[k] = new Item()
|
| | | {
|
| | | id = itemsArray[k][0],
|
| | | count = itemsArray[k][1],
|
| | | bind = itemsArray[k][2] == 1
|
| | | };
|
| | | }
|
| | | dict.Add(trialRewards[i].grade, items);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return trialTokenExchangeDict.TryGetValue(lv, out list);
|
| | | }
|
| | |
|
| | | public bool TryGetTrialRewards(int lineId, int grade, out int[] rewards)
|
| | | public bool TryGetTrialRewards(int lineId, int grade, out Item[] rewards)
|
| | | {
|
| | | rewards = null;
|
| | | if (trialRewardDict.ContainsKey(lineId))
|
| | |
| | |
|
| | | public int grade { get { return m_Grade; } }
|
| | |
|
| | | public void Display(int[] rewards)
|
| | | public void Display(Item[] rewards)
|
| | | {
|
| | | for (int i = 0; i < m_ItemBehaviours.Length; i++)
|
| | | {
|
| | |
| | | if (i < rewards.Length)
|
| | | {
|
| | | behaviour.gameObject.SetActive(true);
|
| | | behaviour.SetItem(rewards[i], 0);
|
| | | behaviour.SetItem(rewards[i]);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | private set;
|
| | | }
|
| | | public readonly int buffTypeId = 22203;
|
| | | public Dictionary<int, List<AwardItem>> integralRankAwardDict = new Dictionary<int, List<AwardItem>>();
|
| | | public Dictionary<int, List<IntegralRankItem>> integralRankAwardDict = new Dictionary<int, List<IntegralRankItem>>();
|
| | | public int[] integralRankAwardPer { get; private set; }
|
| | | public int integralAddition { get; private set; }
|
| | | public Dictionary<int, int[]> crystalSortDict { get; private set; }
|
| | |
| | | foreach (Match match in _regex.Matches(cfg.Numerical1))
|
| | | {
|
| | | var _rank = int.Parse(match.Groups[1].Value);
|
| | | List<AwardItem> _list = ParseAward(StringUtility.Contact('[', match.Groups[2].Value, ']'));
|
| | | var _value = StringUtility.Contact('[', match.Groups[2].Value, ']');
|
| | | List<IntegralRankItem> _list = ParseAward(LitJson.JsonMapper.ToObject<int[][]>(_value));
|
| | | integralRankAwardDict.Add(_rank, _list);
|
| | | }
|
| | | integralRankAwardPer = JsonMapper.ToObject<int[]>(cfg.Numerical2);
|
| | |
| | | _item.item.id = _array[i][0];
|
| | | _item.item.count = _array[i][1];
|
| | | _item.isBind = _array[i][2];
|
| | | _list.Add(_item);
|
| | | }
|
| | | }
|
| | | return _list;
|
| | | }
|
| | |
|
| | | private List<IntegralRankItem> ParseAward(int[][] itemsArray)
|
| | | {
|
| | | List<IntegralRankItem> _list = new List<IntegralRankItem>();
|
| | | if (itemsArray != null)
|
| | | {
|
| | | for (int i = 0; i < itemsArray.Length; i++)
|
| | | {
|
| | | IntegralRankItem _item = new IntegralRankItem();
|
| | | _item.id = itemsArray[i][0];
|
| | | _item.count = itemsArray[i][1];
|
| | | _item.bind = itemsArray[i][2];
|
| | | _item.isPer = itemsArray[i].Length > 3 ? itemsArray[i][3] : 1;
|
| | | _list.Add(_item);
|
| | | }
|
| | | }
|
| | |
| | | public int IsFinalMatch;
|
| | | }
|
| | | }
|
| | |
|
| | | public struct IntegralRankItem
|
| | | {
|
| | | public int id;
|
| | | public int count;
|
| | | public int bind;
|
| | | public int isPer;
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public class AwardItemUI
|
| | | {
|
| | |
| | | m_FightTimeTxt.text = TimeUtility.SecondsToHMS(_data.FightTime);
|
| | | m_WinImg.gameObject.SetActive(_data.IsWin);
|
| | | var _rankKey = UIHelper.GetIntervalAward(model.integralRankAwardDict.Keys, _index + 1);
|
| | | var _Award = model.integralRankAwardDict[_rankKey][0];
|
| | | var _per = model.integralRankAwardPer[model.fairyLeagueGroupId - 1];
|
| | | var _count = (int)Mathf.Max(_Award.item.count * ((float)_per / 100), 1);
|
| | | m_IntegralAward.Init(_Award.item.id, _count, _Award.isBind);
|
| | | var _item = model.integralRankAwardDict[_rankKey][0];
|
| | | var _per = 100;
|
| | | if ((model.fairyLeagueGroupId - 1) >= 0
|
| | | && (model.fairyLeagueGroupId - 1) < model.integralRankAwardPer.Length)
|
| | | {
|
| | | _per = model.integralRankAwardPer[model.fairyLeagueGroupId - 1];
|
| | | }
|
| | | var _count = (int)Mathf.Max(_item.count * (_item.isPer == 1 ? ((float)_per / 100) : 1), 1);
|
| | | m_IntegralAward.Init(_item.id, _count, _item.bind);
|
| | | m_IntegralAward.itemCnt.text = StringUtility.Contact("X", _count);
|
| | | m_ContainChampion.gameObject.SetActive(model.fairyLeagueGroupId == 5 && _index == model.GetBattleFirstPlayer());
|
| | | m_ChampionAwardBtn.onClick.RemoveAllListeners();
|
| | |
| | | if (_dict != null)
|
| | | {
|
| | | _rankKey = UIHelper.GetIntervalAward(_dict.Keys, (int)PlayerDatas.Instance.worldLv);
|
| | | _Award = _dict[_rankKey][0];
|
| | | var _Award = _dict[_rankKey][0];
|
| | | m_ChampionAward.Init(_Award.item.id, Mathf.Min(1, _Award.item.count), _Award.isBind);
|
| | | m_ChampionAwardBtn.onClick.AddListener(() =>
|
| | | {
|
| | |
| | | ParseConfig();
|
| | | ParseFakeFairy();
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo += OnRefreshFairyInfo;
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyMine += OnRefreshFairyMine;
|
| | | TimeMgr.Instance.OnSyntonyEvent += OnSyntonyEvent;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | dungeonModel.dungeonCoolDownEvent += OnBeginTimeEvent;
|
| | |
| | | UpdateAddFairyRedpoint();
|
| | | }
|
| | |
|
| | | private void OnRefreshFairyMine()
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public void GotoFairyWin(int functionOrder = 0)
|
| | | {
|
| | | if (functionOrder == 0)
|
| | |
| | | int needMoney = needToolCnt * xbOneMoney;
|
| | | if(needToolCnt > 0)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("HappyXBCostTools", funcSet.costToolNums[1],needMoney,needToolCnt), (bool isOk) =>
|
| | | ItemConfig itemConfig = ConfigManager.Instance.GetTemplate<ItemConfig>(funcSet.costToolIds[1]);
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("HappyXBCostTools", funcSet.costToolNums[1], itemConfig.ItemName,needMoney, needToolCnt), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | |
| | | {
|
| | | maskObj.SetActive(true);
|
| | | isXBMany = true;
|
| | | XBModel.SendXBQuest(1, 1, 0);
|
| | | XBModel.SendXBQuest(1, 1, 2);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | int needMoney = needToolCnt * xbOneMoney;
|
| | | if (needToolCnt > 0)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("HappyXBCostTools", funcSet.costToolNums[1], needMoney, needToolCnt), (bool isOk) =>
|
| | | ItemConfig itemConfig = ConfigManager.Instance.GetTemplate<ItemConfig>(funcSet.costToolIds[1]);
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("HappyXBCostTools", funcSet.costToolNums[1], itemConfig.ItemName,needMoney, needToolCnt), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | |
| | | {
|
| | | maskObj.SetActive(true);
|
| | | isXBMany = true;
|
| | | XBModel.SendXBQuest(2, 1, 0);
|
| | | XBModel.SendXBQuest(2, 1, 2);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | switch (attrData.winType)
|
| | | {
|
| | | case ItemWinType.equipWin:
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.putOn, (ItemWinBtnType, ItemAttrData) => { dogzModel.SendPutOnEquip(dogzModel.presentSelectDogz, attrData.index); });
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.putOn, (ItemWinBtnType, ItemAttrData) => { dogzModel.SendPutOnEquip(attrData.index); });
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | if (attrData == null) return;
|
| | |
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.putOff, (ItemWinBtnType, ItemAttrData) => {
|
| | | dogzModel.SendPutOffEquip(dogzModel.presentSelectDogz,dogzModel.GetDogzEquipPlaceByIndex(attrData.index));
|
| | | dogzModel.SendPutOffEquip(dogzModel.GetDogzEquipPlaceByIndex(attrData.index));
|
| | | });
|
| | |
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.strength, (ItemWinBtnType, ItemAttrData) => {
|
| | |
| | | [SerializeField] Button m_BagualuBtn;//八卦炉
|
| | |
|
| | | [SerializeField] Button m_TreasureSoulBtn;//觉醒按钮
|
| | |
|
| | | [SerializeField] Button m_GodBeastBtn;//神兽按钮
|
| | | public void Init()
|
| | | {
|
| | | _Role1Btn.onClick.AddListener(Role1Button);
|
| | |
| | | _RankingListBtn.onClick.AddListener(RankingListButton);
|
| | | m_BagualuBtn.AddListener(OnClickBagualuBtn);
|
| | | m_TreasureSoulBtn.AddListener(OnClickTreasureSoul);
|
| | | m_GodBeastBtn.AddListener(GodBeastBtn);
|
| | | }
|
| | |
|
| | | public void UnInit()
|
| | |
| | | _SetUp1Btn.onClick.RemoveAllListeners();
|
| | | _RankingListBtn.onClick.RemoveAllListeners();
|
| | | m_BagualuBtn.RemoveAllListeners();
|
| | | m_GodBeastBtn.RemoveAllListeners();
|
| | | }
|
| | |
|
| | | void Role1Button()
|
| | |
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<TreasureSoulWin>();
|
| | | }
|
| | | //private void OnRealmButton()
|
| | | //{
|
| | | // WindowCenter.Instance.Open<RealmWin>();
|
| | | // WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | //}
|
| | | private void GodBeastBtn()
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<DogzWin>();
|
| | | }
|
| | |
|
| | | void Strengthen1Button()
|
| | | {
|
| | |
| | | PlayerDeadModel playerDeadModel { get { return ModelCenter.Instance.GetModel<PlayerDeadModel>(); } }
|
| | | TeamModel teamModel { get { return ModelCenter.Instance.GetModel<TeamModel>(); } }
|
| | | DailyQuestModel dailyModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | | PlayerPackModel packModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | public event Action guideStepChangeEvent;
|
| | | public event Action guideBeginEvent;
|
| | |
| | | case GuideTriggerType.RealmSitDown:
|
| | | return false;
|
| | | case GuideTriggerType.ItemCompound:
|
| | | return composeModel.IsComposeTicketByType(config.Condition);
|
| | | return IsComposeEnough(config.Condition);
|
| | | case GuideTriggerType.HangUpResult:
|
| | | return true;
|
| | | case GuideTriggerType.BranchQuestCando:
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private bool IsComposeEnough(int _secondType)
|
| | | {
|
| | | var itemId = composeModel.GetTicketId((int)ComposeFuncType.Ticket, _secondType, 0);
|
| | | var lackItem = dungeonModel.GetLackItem(DungeonSuppliesLackWin.lackType);
|
| | | if (lackItem.id != itemId || itemId == 0)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var singlepack = packModel.GetSinglePackModel(PackType.rptItem);
|
| | | var count = singlepack != null ? singlepack.GetItemCountByID(itemId) : 0;
|
| | | return composeModel.IsComposeTicketByType(_secondType) && count == 0;
|
| | | }
|
| | |
|
| | | private void OnPlayerDead()
|
| | | {
|
| | | if (currentGuide != 0)
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Monday, August 20, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI { |
| | | |
| | | public class GodBeastChildNodes:MonoBehaviour { |
| | | [SerializeField] ItemCell m_ItemCell; |
| | | [SerializeField] GameObject m_ChoosenImg; |
| | | [SerializeField] Text m_TextNumber; |
| | | [SerializeField] Button m_Button;
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } } |
| | | public Button ButtonDown
|
| | | {
|
| | | get { return m_Button; }
|
| | | set { m_Button = value; }
|
| | | } |
| | | public GameObject ChoosenImg
|
| | | {
|
| | | get { return m_ChoosenImg; }
|
| | | set { m_ChoosenImg = value; }
|
| | | } |
| | | public ItemCell ItemCell
|
| | | {
|
| | | get { return m_ItemCell; }
|
| | | set { m_ItemCell = value; }
|
| | | } |
| | | public Text TextNumber
|
| | | {
|
| | | get { return m_TextNumber; }
|
| | | set { m_TextNumber = value; }
|
| | | } |
| | | |
| | | public void GetGodBeastIndex(int Index)
|
| | | {
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptDogzItem, Index);
|
| | | m_ItemCell.Init(itemModel);
|
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | TextNumber.gameObject.SetActive(false);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | int lv = IudetDogzEquipPlus[0];
|
| | | if (lv > 0)
|
| | | {
|
| | | TextNumber.gameObject.SetActive(true);
|
| | | TextNumber.text = "+" + lv;
|
| | | TextNumber.color = UIHelper.GetUIColor(itemModel.chinItemModel.ItemColor);
|
| | | }
|
| | | }
|
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 589b5dafae4252347a827e827ae08ba3 |
| | | timeCreated: 1534766620 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | [SerializeField] ItemCell m_itemCell; |
| | | [SerializeField] GameObject m_Selectedbar_Image; |
| | | [SerializeField] Text m_Item_Text; |
| | | //[SerializeField] Button // |
| | | [SerializeField] Button m_GodBeastButton; |
| | | |
| | | public Button GodBeastButton
|
| | | {
|
| | | get { return m_GodBeastButton; }
|
| | | set { m_GodBeastButton = value; }
|
| | | } |
| | | |
| | | DogzModel Dogz_model;
|
| | | DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } } |
| | | public void GetGodBeastLocationMarker(int locationMarker)
|
| | | public void GetGodBeastLocationMarker(int locationMarker, int currentlySelected)
|
| | | {
|
| | | int godBeastNumber = locationMarker / 10;
|
| | | int godBeastPart = locationMarker % 10;
|
| | | int godBeastNumber = locationMarker % 100;//神兽编号
|
| | | int godBeastPart = locationMarker / 100;//神兽装备位ID
|
| | | List<ItemModel> itemModel = dogz_model.GetDogzEquips(godBeastNumber);
|
| | | if (itemModel != null)
|
| | | {
|
| | |
| | | {
|
| | | m_Item_Text.text = itemConfig.ItemName;
|
| | | }
|
| | | if (locationMarker == currentlySelected)
|
| | | {
|
| | | m_Selectedbar_Image.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Selectedbar_Image.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | } |
| | | } |
| | | |
| | |
| | | public int GodBeastQuality;//神兽品质
|
| | | public int GodBeastStar;//神兽星级
|
| | | public int LocationMarker;//位置标记
|
| | | public int EquipScore;//装备评分
|
| | | } |
| | | public class GodBeastReinforcementWin : Window |
| | | {
|
| | |
| | | DogzModel Dogz_model;
|
| | | DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } } |
| | | private List<GodBeastClass> GodBeastList = new List<GodBeastClass>(); |
| | | private int CurrentlySelected = 0; |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | |
| | | OnCreateGridLineCell(m_ScrollerController); |
| | | if (GodBeastList.Count > 0)
|
| | | {
|
| | | CurrentlySelected = GodBeastList[0].LocationMarker;
|
| | | m_ScrollerController.JumpIndex(0);
|
| | | } |
| | | m_GodBeastSlidingList.Init(); |
| | |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | {
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | { |
| | | m_ScrollerController.OnRefreshCell -= OnRefreshGridCell; |
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (DogzEquipDict[key] == 1)
|
| | | {
|
| | | GodBeastClass godBeastClass = new GodBeastClass();
|
| | | |
| | | List<ItemModel> itemModel = dogz_model.GetDogzEquips(key);
|
| | | for (int i = 0; i < itemModel.Count; i++)
|
| | | {
|
| | | GodBeastClass godBeastClass = new GodBeastClass();
|
| | | godBeastClass.GodBeastNumber = key;
|
| | | godBeastClass.GodBeastPart = itemModel[i].EquipPlace;
|
| | | godBeastClass.GodBeastQuality = itemModel[i].chinItemModel.ItemColor;
|
| | | godBeastClass.GodBeastStar = itemModel[i].chinItemModel.StarLevel;
|
| | | godBeastClass.EquipScore = itemModel[i].equipScore;
|
| | | var IudetDogzEquipPlus = itemModel[i].GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | godBeastClass.GodBeastLv = IudetDogzEquipPlus[0];
|
| | | godBeastClass.GodBeasProficiency = IudetDogzEquipPlus[1];
|
| | | godBeastClass.LocationMarker= key*10+ itemModel[i].EquipPlace;
|
| | | if (IudetDogzEquipPlus == null)
|
| | | {
|
| | | godBeastClass.GodBeastLv = 0;
|
| | | godBeastClass.GodBeasProficiency = 0;
|
| | | }
|
| | | else
|
| | | {
|
| | | godBeastClass.GodBeastLv = IudetDogzEquipPlus[0];
|
| | | godBeastClass.GodBeasProficiency = IudetDogzEquipPlus[1];
|
| | | } |
| | | godBeastClass.LocationMarker=itemModel[i].EquipPlace*100+key;
|
| | | GodBeastList.Add(godBeastClass);
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | return -x.GodBeasProficiency.CompareTo(y.GodBeasProficiency);
|
| | | }
|
| | | if (x.EquipScore.CompareTo(y.EquipScore) != 0)//装备评分
|
| | | {
|
| | | return -x.EquipScore.CompareTo(y.EquipScore);
|
| | | }
|
| | | return 1;
|
| | | } |
| | | void OnCreateGridLineCell(ScrollerController gridCtrl)
|
| | |
| | | {
|
| | | GodBeastEntry godBeastEntry = cell.GetComponent<GodBeastEntry>();
|
| | | int locationMarker = cell.index;
|
| | | godBeastEntry.GetGodBeastLocationMarker(locationMarker, CurrentlySelected);
|
| | | godBeastEntry.GodBeastButton.RemoveAllListeners();
|
| | | godBeastEntry.GodBeastButton.AddListener(()=> |
| | | {
|
| | | if (locationMarker != CurrentlySelected)
|
| | | {
|
| | | CurrentlySelected = locationMarker;
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | } |
| | | });
|
| | | } |
| | | } |
| | | |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | //神兽强化右侧材料吸收列表 |
| | | namespace Snxxz.UI { |
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | //神兽强化右侧材料吸收列表
|
| | | namespace Snxxz.UI
|
| | | { |
| | | public class GodBeastBagClass
|
| | | {
|
| | | public int ItemId;//ID
|
| | | public int Index;//下标
|
| | | public int IsEquipment;//是否装备0水晶,1装备
|
| | | public int Color;//品质颜色
|
| | | public int Star;//星级
|
| | | public int LV;//等级
|
| | | public int Proficiency;//熟练度
|
| | | public int EquipScore;//装备评分
|
| | | public int Part;//装备位
|
| | | } |
| | | |
| | | public class GodBeastSlidingList:MonoBehaviour {
|
| | | public class GodBeastSlidingList : MonoBehaviour
|
| | | {
|
| | | [SerializeField] ScrollerController m_ScrollerController;
|
| | |
|
| | | [SerializeField] Text m_Label;
|
| | |
| | | [SerializeField] Toggle m_ToggleAll;
|
| | | public int LINE = 10;
|
| | |
|
| | | public static event Action<Dictionary<int, int>> AbsorbEvent;
|
| | | private List<GodBeastBagClass> GodBeastBagList = new List<GodBeastBagClass>();
|
| | | private List<int> DeleteIndexList = new List<int>();
|
| | | private Dictionary<int, int> AbsorptionDic = new Dictionary<int, int>();
|
| | | private int Quality = 10;
|
| | | PlayerPackModel _playerPack; |
| | | PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
|
| | | private void Start()
|
| | | {
|
| | | m_Arrow.AddListener(OnClickArrow);
|
| | | m_ButtonAll.AddListener(()=>{ OnClickSwith(10); });
|
| | | m_ButtonCrystal.AddListener(() => { OnClickSwith(1);});
|
| | | m_ButtonBlue.AddListener(() => { OnClickSwith(2); });
|
| | | m_ButtonPurple.AddListener(() => { OnClickSwith(3); });
|
| | | m_ButtonOrange.AddListener(() => { OnClickSwith(4); });
|
| | | m_ButtonAll.AddListener(() =>
|
| | | {
|
| | | OnClickSwith(10);
|
| | | if (m_ToggleAll.isOn)
|
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | if (AbsorbEvent != null)
|
| | | {
|
| | | AbsorbEvent(AbsorptionDic);
|
| | | }
|
| | | });
|
| | | m_ButtonCrystal.AddListener(() =>
|
| | | {
|
| | | OnClickSwith(0);
|
| | | if (m_ToggleAll.isOn)
|
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | if (AbsorbEvent != null)
|
| | | {
|
| | | AbsorbEvent(AbsorptionDic);
|
| | | }
|
| | | });
|
| | | m_ButtonBlue.AddListener(() =>
|
| | | {
|
| | | OnClickSwith(2);
|
| | | if (m_ToggleAll.isOn)
|
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | if (AbsorbEvent != null)
|
| | | {
|
| | | AbsorbEvent(AbsorptionDic);
|
| | | }
|
| | | });
|
| | | m_ButtonPurple.AddListener(() =>
|
| | | {
|
| | | OnClickSwith(3);
|
| | | if (m_ToggleAll.isOn)
|
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | if (AbsorbEvent != null)
|
| | | {
|
| | | AbsorbEvent(AbsorptionDic);
|
| | | }
|
| | | });
|
| | | m_ButtonOrange.AddListener(() =>
|
| | | {
|
| | | OnClickSwith(4);
|
| | | if (m_ToggleAll.isOn)
|
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | if (AbsorbEvent != null)
|
| | | {
|
| | | AbsorbEvent(AbsorptionDic);
|
| | | }
|
| | | });
|
| | | m_ToggleAll.onValueChanged.AddListener(OnClickToggle);
|
| | | } |
| | | private void OnEnable()
|
| | | {
|
| | | |
| | |
|
| | | } |
| | | private void OnDisable()
|
| | | {
|
| | | |
| | |
|
| | | } |
| | | |
| | | public void Init()
|
| | | public void Init()
|
| | | {
|
| | | Quality = 10;
|
| | | ContentSelect(Quality);
|
| | |
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();//获取神兽背包数据排序
|
| | | FilterQuality();//分类筛选
|
| | | m_ScrollerController.OnRefreshCell += OnRefreshGridCell;
|
| | | OnCreateGridLineCell(m_ScrollerController);
|
| | |
|
| | |
| | | m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
|
| | | }
|
| | |
|
| | | private void GetGodBeastBag()//获取神兽背包数据排序
|
| | | {
|
| | | GodBeastBagList.Clear();
|
| | | if (playerPack.GetSinglePackModel(PackType.rptDogzItem) == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | Dictionary<int, ItemModel> BackpackDic = playerPack.GetSinglePackModel(PackType.rptDogzItem).GetPackModelIndexDict();
|
| | | foreach (var key in BackpackDic.Keys)
|
| | | {
|
| | | var itemModel = BackpackDic[key];
|
| | | GodBeastBagClass godBeastBagClass = new GodBeastBagClass();
|
| | | godBeastBagClass.ItemId = itemModel.itemId;
|
| | | godBeastBagClass.Index = key;
|
| | | if (itemModel.chinItemModel.Type != 70)
|
| | | {
|
| | | godBeastBagClass.IsEquipment = 1;
|
| | | }
|
| | | else
|
| | | {
|
| | | godBeastBagClass.IsEquipment = 0;
|
| | | }
|
| | | godBeastBagClass.Color = itemModel.chinItemModel.ItemColor;
|
| | | godBeastBagClass.Star = itemModel.chinItemModel.StarLevel;
|
| | | godBeastBagClass.EquipScore = itemModel.equipScore;
|
| | | godBeastBagClass.Part = itemModel.EquipPlace;
|
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | if (IudetDogzEquipPlus == null)
|
| | | {
|
| | | godBeastBagClass.LV = 0;
|
| | | godBeastBagClass.Proficiency = 0;
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | godBeastBagClass.LV = IudetDogzEquipPlus[0];
|
| | | godBeastBagClass.Proficiency = IudetDogzEquipPlus[1];
|
| | | }
|
| | |
|
| | | GodBeastBagList.Add(godBeastBagClass);
|
| | | }
|
| | | GodBeastBagList.Sort(Compare);
|
| | | }
|
| | | int Compare(GodBeastBagClass x, GodBeastBagClass y)
|
| | | {
|
| | | if (x.IsEquipment.CompareTo(y.IsEquipment) != 0)//是否强化水晶
|
| | | {
|
| | | return x.IsEquipment.CompareTo(y.IsEquipment);
|
| | | }
|
| | | if (x.Proficiency.CompareTo(y.Proficiency) != 0)//强化熟练度
|
| | | {
|
| | | return -x.Proficiency.CompareTo(y.Proficiency);
|
| | | }
|
| | | if (x.Color.CompareTo(y.Color) != 0)//品质
|
| | | {
|
| | | return -x.Color.CompareTo(y.Color);
|
| | | }
|
| | | if (x.Star.CompareTo(y.Star) != 0)//星级
|
| | | {
|
| | | return -x.Star.CompareTo(y.Star);
|
| | | }
|
| | | if (x.Part.CompareTo(y.Part) != 0)//装备位
|
| | | {
|
| | | return x.Part.CompareTo(y.Part);
|
| | | }
|
| | | if (x.EquipScore.CompareTo(y.EquipScore) != 0)//装备评分
|
| | | {
|
| | | return x.EquipScore.CompareTo(y.EquipScore);
|
| | | }
|
| | | return 1;
|
| | | }
|
| | |
|
| | | private void FilterQuality()//分类筛选
|
| | | {
|
| | | DeleteIndexList.Clear();
|
| | | AbsorptionDic.Clear();
|
| | | for (int i = 0; i < GodBeastBagList.Count; i++)
|
| | | {
|
| | | if (Quality <= 0)//只有水晶
|
| | | {
|
| | | if (GodBeastBagList[i].IsEquipment != 0)
|
| | | {
|
| | | int type = i;
|
| | | DeleteIndexList.Add(type);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (Quality < 10 && GodBeastBagList[i].IsEquipment != 1 && GodBeastBagList[i].Color > Quality)//过滤掉只剩所选品质装备
|
| | | {
|
| | | int type = i;
|
| | | DeleteIndexList.Add(type);
|
| | | }
|
| | | }
|
| | | }
|
| | | for (int j = DeleteIndexList.Count; j > 0; j--)
|
| | | {
|
| | | int Inedex = DeleteIndexList[j - 1];
|
| | | if (Inedex <= GodBeastBagList.Count - 1)
|
| | | {
|
| | | GodBeastBagList.RemoveAt(Inedex);
|
| | | }
|
| | | }
|
| | | if (m_ToggleAll.isOn)
|
| | | {
|
| | | for (int k = 0; k < GodBeastBagList.Count; k++)
|
| | | {
|
| | | AbsorptionDic.Add(GodBeastBagList[k].Index, 1);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickArrow()
|
| | | {
|
| | | m_ScrollViewFirst.SetActive(!m_ScrollViewFirst.activeSelf);
|
| | |
| | |
|
| | | private void OnClickToggle(bool IsBool)
|
| | | {
|
| | | if (IsBool)
|
| | | {
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | if (AbsorptionDic.Count != 0)
|
| | | {
|
| | | AbsorptionDic.Clear();
|
| | | }
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | if (AbsorbEvent != null)
|
| | | {
|
| | | AbsorbEvent(AbsorptionDic);
|
| | | }
|
| | | }
|
| | | private void OnClickSwith(int Type)
|
| | | {
|
| | |
| | | {
|
| | | switch (Type)
|
| | | {
|
| | | case 1:
|
| | | case 0:
|
| | | m_Label.text = "强化水晶";
|
| | | break;
|
| | | case 2:
|
| | |
| | | int childCode = 0;
|
| | | for (childCode = 0; childCode < cell.transform.childCount; childCode++)
|
| | | {
|
| | | ChildNodes _ChildNodes = cell.transform.GetChild(childCode).GetComponent<ChildNodes>();
|
| | | _ChildNodes._ItemIcon.SetActive(false);
|
| | | _ChildNodes._Elect.SetActive(false);
|
| | | GodBeastChildNodes GodBeastChildNodes = cell.transform.GetChild(childCode).GetComponent<GodBeastChildNodes>();
|
| | | GodBeastChildNodes.ItemCell.gameObject.SetActive(false);
|
| | | GodBeastChildNodes.ChoosenImg.SetActive(false);
|
| | | GodBeastChildNodes.TextNumber.gameObject.SetActive(false);
|
| | | int cellCount = (cell.transform.childCount) * gridlineIndex + (childCode + 1);
|
| | | if (cellCount - 1 < 1)
|
| | | GodBeastChildNodes.ButtonDown.RemoveAllListeners();
|
| | | if (cellCount - 1 < GodBeastBagList.Count)
|
| | | {
|
| | |
|
| | |
|
| | | int index = cellCount - 1;
|
| | | GodBeastChildNodes.ItemCell.gameObject.SetActive(true);
|
| | | GodBeastBagClass godBeastBagClass = GodBeastBagList[index];
|
| | | if (AbsorptionDic.ContainsKey(godBeastBagClass.Index))
|
| | | {
|
| | | GodBeastChildNodes.ChoosenImg.SetActive(true);
|
| | | }
|
| | | GodBeastChildNodes.GetGodBeastIndex(godBeastBagClass.Index);
|
| | | GodBeastChildNodes.ButtonDown.AddListener(() =>
|
| | | {
|
| | | if (AbsorptionDic.ContainsKey(godBeastBagClass.Index))
|
| | | {
|
| | | AbsorptionDic.Remove(godBeastBagClass.Index);
|
| | | }
|
| | | else
|
| | | {
|
| | | AbsorptionDic.Add(godBeastBagClass.Index, 1);
|
| | | }
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | if (AbsorbEvent != null)
|
| | | {
|
| | | AbsorbEvent(AbsorptionDic);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | } |
| | |
| | | }
|
| | | break;
|
| | | case ShowStep.ShowUnlock:
|
| | | m_FuncUnLockSlider.value = timer / (6 * stageTime);
|
| | | if (timer > 3 * stageTime)
|
| | | var length = m_TreasureNewGots.Length;
|
| | | m_FuncUnLockSlider.value = timer / (length * stageTime);
|
| | | if (timer > length * stageTime)
|
| | | {
|
| | | timer = 0f;
|
| | | showStep = ShowStep.ShowComplete;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | for (int i = 0; i < m_Treasure.potentials.Count; i++)
|
| | | {
|
| | | if (model.SatisyPotentialLevelUp(_treasure.id, m_Treasure.potentials[i].id))
|
| | | {
|
| | | _index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | selectedPotential = m_Treasure.potentials[_index].id;
|
| | |
|
| | | for (int i = 0; i < potentialBriefInfos.Length; i++)
|
| | |
| | | for (int i = 0; i < vNetData.FuncCount; i++)
|
| | | {
|
| | | var funcState = vNetData.FuncStateList[i];
|
| | | bool opned = funcOpenState[funcState.FuncID];
|
| | | funcOpenState[funcState.FuncID] = funcState.State == 1;
|
| | | if (!funcOpenState.ContainsKey(funcState.FuncID))
|
| | | {
|
| | | funcOpenState.Add(funcState.FuncID, funcState.State == 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | funcOpenState[funcState.FuncID] = funcState.State == 1;
|
| | | }
|
| | | if (OnFuncStateChangeEvent != null)
|
| | | {
|
| | | OnFuncStateChangeEvent(funcState.FuncID);
|