Merge branch 'master' into DogzDungeon
| | |
| | | private void ExcuteBuildLevels()
|
| | | {
|
| | | UpdateLevelSetting.SetAllLevelAssetBundleName();
|
| | |
|
| | | var grachicSettings = new SerializedObject(AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/GraphicsSettings.asset")[0]);
|
| | | var lightmapStripping = grachicSettings.FindProperty("m_LightmapStripping");
|
| | | lightmapStripping.intValue = 1;
|
| | | var fogStripping = grachicSettings.FindProperty("m_FogStripping");
|
| | | fogStripping.intValue = 1;
|
| | |
|
| | | grachicSettings.ApplyModifiedProperties();
|
| | |
|
| | | ExcuteBuildAsset("maps");
|
| | | }
|
| | |
|
| | |
| | | StartSyncTask<IconConfig>(AssetPath.ResourceOut);
|
| | | StartSyncTask<SysInfoConfig>(AssetPath.ResourceOut);
|
| | | StartSyncTask<LanguageConfig>(AssetPath.ResourceOut);
|
| | | StartSyncTask<RealmConfig>(AssetPath.ResourceOut);
|
| | | }
|
| | |
|
| | | public bool AllCompleted()
|
| | |
| | | public static readonly string controllerSuffix = "AnimatorController_"; |
| | | public static readonly string controllerUISuffix = "AnimatorController_UI_"; |
| | | public static readonly string controllerShowSuffix = "AnimatorController_Show_"; |
| | | public static readonly string controllerRealmSuffix = "AnimatorController_Realm_"; |
| | | |
| | | public static AnimationClip LoadAnimationClip(string name, string clipName) |
| | | { |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Saturday, January 20, 2018
|
| | | //--------------------------------------------------------
|
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using TableConfig;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class RealmBetterEquipModel : Model, IBeforePlayerDataInitialize, ISwitchAccount,IPlayerLoginOk
|
| | | {
|
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | | PackModelInterface modelInterface { get { return ModelCenter.Instance.GetModel<PackModelInterface>(); } }
|
| | |
|
| | | public string currentEquipGuid { get; private set; }
|
| | |
|
| | | Dictionary<string, ItemModel> betterEquipModels = new Dictionary<string, ItemModel>();
|
| | |
|
| | | public event Action showEquipRefreshEvent;
|
| | | public const string RealmRecordKey = "RealmRecord";
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | playerPack.RefreshPackAct += OnPackageRefresh;
|
| | | playerPack.RefreshItemCountAct += OnPackageItemRefresh;
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {;
|
| | | playerPack.RefreshPackAct -= OnPackageRefresh;
|
| | | playerPack.RefreshItemCountAct -= OnPackageItemRefresh;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | currentEquipGuid = string.Empty;
|
| | | betterEquipModels.Clear();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | LocalSave.SetInt(RealmRecordKey,PlayerDatas.Instance.baseData.realmLevel);
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= RefreshRealm;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += RefreshRealm;
|
| | | }
|
| | |
|
| | | public void OnSwitchAccount()
|
| | | {
|
| | | currentEquipGuid = string.Empty;
|
| | | }
|
| | |
|
| | | private void RefreshRealm(PlayerDataRefresh type)
|
| | | {
|
| | | int realmLv = PlayerDatas.Instance.baseData.realmLevel;
|
| | | if (type != PlayerDataRefresh.OfficialRank
|
| | | || LocalSave.GetInt(RealmRecordKey) == realmLv
|
| | | || NewBieCenter.Instance.inGuiding)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | LocalSave.SetInt(RealmRecordKey,realmLv);
|
| | | Dictionary<int, ItemModel> pairs = modelInterface.CheckBetterEquipByRealm();
|
| | | betterEquipModels.Clear();
|
| | | currentEquipGuid = string.Empty;
|
| | | foreach (var model in pairs.Values)
|
| | | {
|
| | | betterEquipModels[model.itemInfo.ItemGUID] = model;
|
| | | currentEquipGuid = model.itemInfo.ItemGUID;
|
| | | }
|
| | | if (showEquipRefreshEvent != null)
|
| | | {
|
| | | showEquipRefreshEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetBetterEquip(string _guid, out ItemModel _equip)
|
| | | {
|
| | | return betterEquipModels.TryGetValue(_guid, out _equip);
|
| | | }
|
| | |
|
| | | public void ReportConfirmBetterEquip(string _guid)
|
| | | {
|
| | | betterEquipModels.Remove(_guid);
|
| | |
|
| | | var tempGuid = GetOneEquip();
|
| | | if (tempGuid != currentEquipGuid)
|
| | | {
|
| | | currentEquipGuid = tempGuid;
|
| | | if (showEquipRefreshEvent != null)
|
| | | {
|
| | | showEquipRefreshEvent();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | private void OnPackageRefresh(PackType _packType)
|
| | | {
|
| | | if (_packType != PackType.rptItem)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var keys = new List<string>(betterEquipModels.Keys);
|
| | | for (int i = keys.Count - 1; i >= 0; i--)
|
| | | {
|
| | | var guid = keys[i];
|
| | | var itemModel = playerPack.GetItemModelByGUID(guid);
|
| | | if (itemModel == null || itemModel.packType != PackType.rptItem)
|
| | | {
|
| | | betterEquipModels.Remove(guid);
|
| | | }
|
| | | }
|
| | |
|
| | | var tempGuid = GetOneEquip();
|
| | | if (tempGuid != currentEquipGuid)
|
| | | {
|
| | | if (!string.IsNullOrEmpty(tempGuid))
|
| | | {
|
| | | currentEquipGuid = tempGuid;
|
| | | if (showEquipRefreshEvent != null)
|
| | | {
|
| | | showEquipRefreshEvent();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | currentEquipGuid = tempGuid;
|
| | | if (showEquipRefreshEvent != null)
|
| | | {
|
| | | showEquipRefreshEvent();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnPackageItemRefresh(PackType _packType, int _index, int _itemId)
|
| | | {
|
| | | if (_packType == PackType.rptEquip)
|
| | | {
|
| | | //穿上装备的时候的处理
|
| | | var item = playerPack.GetItemModelByIndex(_packType, _index);
|
| | | if (item != null)
|
| | | {
|
| | | RemoveLowGradeItemByEquipPlace(_index, item.equipScore);
|
| | | }
|
| | | OnPackageRefresh(PackType.rptItem);
|
| | | }
|
| | | else if (_packType == PackType.rptItem)
|
| | | {
|
| | | OnPackageRefresh(_packType);
|
| | | }
|
| | | }
|
| | |
|
| | | private string GetOneEquip()
|
| | | {
|
| | | var guid = string.Empty;
|
| | | foreach (var key in betterEquipModels.Keys)
|
| | | {
|
| | | guid = key;
|
| | | break;
|
| | | }
|
| | |
|
| | | return guid;
|
| | | }
|
| | |
|
| | | private void RemoveItemByEquipPlace(int _place)
|
| | | {
|
| | | var place = _place == 10 ? 9 : _place;
|
| | | var keys = new List<string>(betterEquipModels.Keys);
|
| | | for (int i = keys.Count - 1; i >= 0; i--)
|
| | | {
|
| | | var item = betterEquipModels[keys[i]];
|
| | | if (item != null && item.chinItemModel.EquipPlace == place)
|
| | | {
|
| | | betterEquipModels.Remove(keys[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void RemoveLowGradeItemByEquipPlace(int _place, int _score)
|
| | | {
|
| | | var place = _place == 10 ? 9 : _place;
|
| | | var keys = new List<string>(betterEquipModels.Keys);
|
| | | for (int i = keys.Count - 1; i >= 0; i--)
|
| | | {
|
| | | var item = betterEquipModels[keys[i]];
|
| | | if (item != null && item.chinItemModel.EquipPlace == place && item.equipScore <= _score)
|
| | | {
|
| | | betterEquipModels.Remove(keys[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private bool TryGetEquipByPlace(int _place, out ItemModel _itemModel)
|
| | | {
|
| | | var place = _place == 10 ? 9 : _place;
|
| | | var keys = new List<string>(betterEquipModels.Keys);
|
| | | for (int i = keys.Count - 1; i >= 0; i--)
|
| | | {
|
| | | var item = betterEquipModels[keys[i]];
|
| | | if (item != null && item.chinItemModel.EquipPlace == place)
|
| | | {
|
| | | _itemModel = item;
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
|
| | | _itemModel = null;
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 368f012abd3595c419a67d33f44153ea |
| | | timeCreated: 1534755541 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | 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)
|
| | | {
|
| | |
| | | m_DogzIcon.SetSprite(_dogzCfg.HeadIcon);
|
| | | m_DogzIcon.SetNativeSize();
|
| | | var _dogzEquips = model.GetDogzEquips(_dogzCfg.ID);
|
| | | m_DogzIcon.material = (_dogzEquips == null || _dogzEquips.Count < 5) ? MaterialUtility.GetDefaultSpriteGrayMaterial() :
|
| | | MaterialUtility.GetUIDefaultGraphicMaterial();
|
| | | bool isActive = (_dogzEquips == null || _dogzEquips.Count < 5) ? false : true;
|
| | | m_DogzName.text = _dogzCfg.Name;
|
| | | //m_DogzGrade.text = StringUtility.Contact("评分:", 100);
|
| | | m_DogzGrade.text = StringUtility.Contact("评分:", 100);
|
| | | if (isActive)
|
| | | {
|
| | | m_DogzIcon.material = MaterialUtility.GetUIDefaultGraphicMaterial();
|
| | | m_DogzName.material = MaterialUtility.GetUIDefaultGraphicMaterial();
|
| | | m_DogzGrade.material = MaterialUtility.GetUIDefaultGraphicMaterial();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_DogzIcon.material = MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | m_DogzName.material = MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | m_DogzGrade.material = MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | }
|
| | | m_DogzBtn.image.color = model.presentSelectDogz == _dogzCfg.ID ? Color.blue : Color.white;
|
| | | m_DogzAssist.gameObject.SetActive(model.TryGetAssistDogzState(_dogzCfg.ID));
|
| | | m_DogzBtn.onClick.RemoveAllListeners();
|
| | |
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(model.itemId,false,(ulong)model.itemInfo.ItemCount,model.itemInfo.ItemPlace,
|
| | | model.itemInfo.IsBind,false,PackType.rptDogzEquip,model.itemInfo.ItemGUID);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | | tipsModel.SetItemTipsModel(model.packType,model.itemInfo.ItemGUID,false,false);
|
| | | tipsModel.SetDogzEquipBtn(tipsModel.curAttrData);
|
| | | tipsModel.ShowUICtrl();
|
| | | });
|
| | | }
|
| | | }
|
| | |
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(model.itemId, false, (ulong)model.itemInfo.ItemCount, model.itemInfo.ItemPlace,
|
| | | model.itemInfo.IsBind, false, PackType.rptDogzItem, model.itemInfo.ItemGUID);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | | tipsModel.SetItemTipsModel(model.packType, model.itemInfo.ItemGUID, false, false);
|
| | | tipsModel.SetDogzItemBtn(tipsModel.curAttrData);
|
| | | tipsModel.ShowUICtrl();
|
| | | });
|
| | | }
|
| | | }
|
| | |
| | | AddAssistItem = int.Parse(_funcCfg.Numerical2);
|
| | | AddAssistItemCnt = ConfigParse.GetMultipleStr<int>(_funcCfg.Numerical3);
|
| | | m_DogzEquipStrenLimit = ConfigParse.GetDic<int, int>(_funcCfg.Numerical4);
|
| | | _funcCfg = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("DogzPack"); |
| | | _funcCfg = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("DogzPack");
|
| | | DogzPackGridCnt = int.Parse(_funcCfg.Numerical1);
|
| | | }
|
| | | /// <summary>
|
| | |
| | |
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(type, index);
|
| | | int dogzId = GetDogzIDByIndex(index);
|
| | | if (itemModel != null)
|
| | | List<ItemModel> modellist = GetDogzEquips(dogzId);
|
| | | if(modellist != null)
|
| | | {
|
| | | for (int i = 0; i < m_DogzEquipDict[dogzId].Count; i++)
|
| | | if (itemModel != null)
|
| | | {
|
| | | if (m_DogzEquipDict[dogzId][i].itemInfo.ItemPlace == index)
|
| | | bool isAdd = true;
|
| | | for (int i = 0; i < modellist.Count; i++)
|
| | | {
|
| | | m_DogzEquipDict[dogzId][i] = itemModel;
|
| | | return;
|
| | | if (modellist[i].itemInfo.ItemPlace == index)
|
| | | {
|
| | | isAdd = false;
|
| | | modellist[i] = itemModel;
|
| | | break;
|
| | | }
|
| | | }
|
| | | if(isAdd)
|
| | | {
|
| | | modellist.Add(itemModel);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | for (int i = 0; i < modellist.Count; i++)
|
| | | {
|
| | | if (modellist[i].itemInfo.ItemPlace == index)
|
| | | {
|
| | | modellist.RemoveAt(i);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | for (int i = 0; i < m_DogzEquipDict[dogzId].Count; i++)
|
| | | if(itemModel != null)
|
| | | {
|
| | | if (m_DogzEquipDict[dogzId][i].itemInfo.ItemPlace == index)
|
| | | {
|
| | | m_DogzEquipDict[dogzId].RemoveAt(i);
|
| | | return;
|
| | | }
|
| | | List<ItemModel> equipDatas = new List<ItemModel>();
|
| | | equipDatas.Add(itemModel);
|
| | | m_DogzEquipDict.Add(dogzId,equipDatas);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if(RefreshDogzEquipAct != null)
|
| | | {
|
| | |
| | | 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);
|
| | | }
|
| | |
| | | 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
|
| | | {
|
| | |
| | | yield return null;
|
| | | if(itemAttrData.isCompare)
|
| | | {
|
| | | if (itemAttrData.packType != PackType.rptEquip)
|
| | | if (itemAttrData.packType != PackType.rptEquip
|
| | | && itemAttrData.packType != PackType.rptDogzEquip)
|
| | | {
|
| | | itemTipsModel.SetCurTips(this.GetComponent<RectTransform>());
|
| | | }
|
| | |
| | | ItemCellModel cellModel = new ItemCellModel(itemAttrData.itemId,itemAttrData.isPreview, (ulong)itemAttrData.count, itemAttrData.isBind,
|
| | | itemAttrData.guid,itemAttrData.packType,itemAttrData.isCompare, itemAttrData.useDataDict);
|
| | | itemCell.Init(cellModel);
|
| | | if(itemAttrData.packType == PackType.rptEquip)
|
| | | if(itemAttrData.packType == PackType.rptEquip
|
| | | || itemAttrData.packType == PackType.rptDogzEquip)
|
| | | {
|
| | | putOnIcon.SetActive(true);
|
| | | }
|
| | |
| | |
|
| | | if (itemAttrData.isCompare)
|
| | | {
|
| | | if(itemAttrData.packType != PackType.rptEquip)
|
| | | if(itemAttrData.packType != PackType.rptEquip
|
| | | && itemAttrData.packType != PackType.rptDogzEquip)
|
| | | {
|
| | | CreateFuncBtn();
|
| | | }
|
| | |
| | | get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
|
| | | }
|
| | |
|
| | | DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | m_storeModel.RefreshTCBPlayerDataEvent += RefreshOfflinePluginTime;
|
| | |
| | | switch (attrData.winType)
|
| | | {
|
| | | case ItemWinType.equipWin:
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.putOn, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendPutOnQuest(ItemWinBtnType.putOn, attrData.guid); });
|
| | | break;
|
| | | case ItemWinType.wingsWin:
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.putOn, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendPutOnQuest(ItemWinBtnType.putOn, attrData.guid); });
|
| | | break;
|
| | | case ItemWinType.guardWin:
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.putOn, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendPutOnQuest(ItemWinBtnType.putOn, attrData.guid); });
|
| | | break;
|
| | |
| | |
|
| | | }
|
| | |
|
| | | public void SetDogzItemBtn(ItemAttrData attrData)
|
| | | {
|
| | | if (attrData == null) return;
|
| | |
|
| | | if (attrData.itemConfig.CanSell == 1)
|
| | | {
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.sell, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendSellQuest(ItemWinBtnType.sell, attrData); });
|
| | | }
|
| | |
|
| | | switch (attrData.winType)
|
| | | {
|
| | | case ItemWinType.equipWin:
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.putOn, (ItemWinBtnType, ItemAttrData) => { dogzModel.SendPutOnEquip(attrData.index); });
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetDogzEquipBtn(ItemAttrData attrData)
|
| | | {
|
| | | if (attrData == null) return;
|
| | |
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.putOff, (ItemWinBtnType, ItemAttrData) => {
|
| | | dogzModel.SendPutOffEquip(dogzModel.GetDogzEquipPlaceByIndex(attrData.index));
|
| | | });
|
| | |
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.strength, (ItemWinBtnType, ItemAttrData) => {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StrengthFunc1);
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 设置仓库弹框按钮
|
| | | /// </summary>
|
| | |
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class PackModelInterface : Model, IBeforePlayerDataInitialize
|
| | | public class PackModelInterface : Model, IBeforePlayerDataInitialize,IPlayerLoginOk
|
| | | {
|
| | | private ItemConfig tagChinModel;
|
| | | private FuncConfigConfig _equipGSFormula;
|
| | |
| | | itemEffectCDDict.Clear();
|
| | | itemEffectTimelist.Clear();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | |
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null) return false;
|
| | |
|
| | | int startLockIndex = singlePack.openGridCount - GetInitGridCount(PackType.rptItem);
|
| | | int startLockIndex = singlePack.openGridCount - playerPack.InitBagGridCnt;
|
| | | FuncConfigConfig _tagFuncModel = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("OpenBagItem");
|
| | | int haveCount = playerPack.GetItemCountByID(PackType.rptItem,itemId);
|
| | | Equation.Instance.Clear();
|
| | |
| | | RefreshPickItemEvent(type,guid);
|
| | | }
|
| | | }
|
| | |
|
| | | Dictionary<int, ItemModel> RealmBetterDict = new Dictionary<int, ItemModel>();
|
| | | public Dictionary<int, ItemModel> CheckBetterEquipByRealm()
|
| | | {
|
| | | RealmBetterDict.Clear();
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null) return RealmBetterDict;
|
| | |
|
| | | int realmLv = PlayerDatas.Instance.baseData.realmLevel;
|
| | | Dictionary<int,ItemModel> pairs = singlePack.GetPackModelIndexDict();
|
| | | foreach(var model in pairs.Values)
|
| | | {
|
| | | if(model.chinItemModel.EquipPlace > 0
|
| | | && model.chinItemModel.EquipPlace != (int)RoleEquipType.retSpiritAnimal
|
| | | && model.chinItemModel.RealmLimit <= realmLv
|
| | | && !IsOverdue(model.itemInfo.ItemGUID,model.itemId,model.useDataDict)
|
| | | && IsFightUp(model.itemId,model.equipScore) == 1)
|
| | | {
|
| | | if(!RealmBetterDict.ContainsKey(model.EquipPlace))
|
| | | {
|
| | | RealmBetterDict.Add(model.EquipPlace,model);
|
| | | }
|
| | | else
|
| | | {
|
| | | if(model.equipScore > RealmBetterDict[model.EquipPlace].equipScore)
|
| | | {
|
| | | RealmBetterDict[model.EquipPlace] = model;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return RealmBetterDict;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 解锁格子
|
| | |
|
| | | public int GetInitGridCount(PackType type)
|
| | | {
|
| | | FuncConfigConfig initGridCount = null;
|
| | | if (type == PackType.rptItem)
|
| | | initGridCount = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("InitBagCellCount");
|
| | | else if (type == PackType.rptWarehouse)
|
| | | initGridCount = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("InitDepotCellCount");
|
| | |
|
| | | return int.Parse(initGridCount.Numerical1);
|
| | | }
|
| | |
|
| | | public void OpenGrid(int chooseGridCount, PackType type)
|
| | | {
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(type);
|
| | | int openCount = chooseGridCount - singlePack.openGridCount;
|
| | | int index = chooseGridCount - GetInitGridCount(type);
|
| | | int index = 0;
|
| | | switch(type)
|
| | | {
|
| | | case PackType.rptItem:
|
| | | index = chooseGridCount - playerPack.InitBagGridCnt;
|
| | | break;
|
| | | case PackType.rptWarehouse:
|
| | | index = chooseGridCount - playerPack.InitDepotGridCnt;
|
| | | break;
|
| | | }
|
| | | itemTipsModel.SetExtendGirdModel(openCount,index, type);
|
| | | WindowCenter.Instance.Open<ExtendWin>();
|
| | | }
|
| | |
| | |
|
| | | if (useItemModel.itemId == 951)
|
| | | {
|
| | | int startLockIndex = singlePack.openGridCount - modelInterface.GetInitGridCount(PackType.rptItem);
|
| | | int startLockIndex = singlePack.openGridCount - playerPack.InitBagGridCnt;
|
| | | int chooseGridCnt = singlePack.openGridCount + GetExtendGridCnt(startLockIndex);
|
| | | modelInterface.OpenGrid(chooseGridCnt, PackType.rptItem);
|
| | | return;
|
| | |
| | | {
|
| | | extendCnt = 1;
|
| | | }
|
| | | int remianLock = playerPack.MaxBagGridCnt - playerPack.GetSinglePackModel(PackType.rptItem).openGridCount;
|
| | | if(extendCnt > remianLock)
|
| | | {
|
| | | extendCnt = remianLock;
|
| | | }
|
| | | return extendCnt;
|
| | | }
|
| | | }
|
| | |
| | | public Dictionary<int, Dictionary<int, int>> decomposeAttrDict = new Dictionary<int, Dictionary<int, int>>();
|
| | | public static string StrengthAttrShift_RecordKey = "StrengthAttrShift";
|
| | | public const string RecordKnapsackTitle = "RecordKnapsackTitle";
|
| | | public int MaxBagGridCnt { get; private set; }
|
| | | public int InitBagGridCnt { get; private set; }
|
| | | public int MaxDepotGridCnt { get; private set; }
|
| | | public int InitDepotGridCnt { get; private set; }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | List<DungeonOpenTimeConfig> dungeonlist = ConfigManager.Instance.GetAllValues<DungeonOpenTimeConfig>();
|
| | |
| | | minDecomposeNum = int.Parse(equipDecompose.Numerical1);
|
| | | defaultUnSelectlist = ConfigParse.GetMultipleStr<int>(equipDecompose.Numerical2);
|
| | |
|
| | | InitDepotGridCnt = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("InitDepotCellCount").Numerical1);
|
| | | InitBagGridCnt = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("InitBagCellCount").Numerical1);
|
| | | MaxBagGridCnt = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("MaxBagCellCount").Numerical1);
|
| | | MaxDepotGridCnt = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("MaxDepotCellCount").Numerical1);
|
| | |
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, December 05, 2017
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | | using Snxxz.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class RealmBetterEquipBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] RectTransform m_ContainerBetterEquip;
|
| | | [SerializeField] ItemCell m_EquipBehaviour;
|
| | | [SerializeField] Text m_EquipName;
|
| | | [SerializeField] Button m_Close;
|
| | | [SerializeField] Button m_Puton;
|
| | | [SerializeField] Button m_BetterEquipDetail;
|
| | | ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | | RealmBetterEquipModel model { get { return ModelCenter.Instance.GetModel<RealmBetterEquipModel>(); } }
|
| | |
|
| | | private void OnEnable()
|
| | | {
|
| | | m_Close.AddListener(CloseBetterEquip);
|
| | | m_Puton.AddListener(PutOnBetterEquip);
|
| | | m_BetterEquipDetail.AddListener(ShowBetterEquipDetails);
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | m_Close.RemoveAllListeners();
|
| | | m_Puton.RemoveAllListeners();
|
| | | m_BetterEquipDetail.RemoveAllListeners();
|
| | | }
|
| | |
|
| | | public void ShowBetterEquip()
|
| | | {
|
| | | m_ContainerBetterEquip.gameObject.SetActive(false);
|
| | | if (!string.IsNullOrEmpty(model.currentEquipGuid))
|
| | | {
|
| | | ItemModel betterEquip;
|
| | | if (model.TryGetBetterEquip(model.currentEquipGuid, out betterEquip))
|
| | | {
|
| | | DrawBetterEquip(betterEquip);
|
| | | m_ContainerBetterEquip.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | private void PutOnBetterEquip()
|
| | | {
|
| | | PackSendQuestMgr.Instance.SendPutOnQuest(ItemWinBtnType.putOn, model.currentEquipGuid);
|
| | | model.ReportConfirmBetterEquip(model.currentEquipGuid);
|
| | | }
|
| | |
|
| | | private void ShowBetterEquipDetails()
|
| | | {
|
| | | ItemModel betterEquip;
|
| | | if (model.TryGetBetterEquip(model.currentEquipGuid, out betterEquip))
|
| | | {
|
| | | var itemConfig = ConfigManager.Instance.GetTemplate<ItemConfig>(betterEquip.itemInfo.ItemID);
|
| | | itemTipsModel.SetItemTipsModel(PackType.rptItem, betterEquip.itemInfo.ItemGUID);
|
| | | }
|
| | | }
|
| | |
|
| | | private void CloseBetterEquip()
|
| | | {
|
| | | model.ReportConfirmBetterEquip(model.currentEquipGuid);
|
| | | }
|
| | |
|
| | | private void DrawBetterEquip(ItemModel betterModel)
|
| | | {
|
| | | var itemConfig = ConfigManager.Instance.GetTemplate<ItemConfig>(betterModel.itemInfo.ItemID);
|
| | | m_EquipName.text = itemConfig.ItemName;
|
| | | m_EquipName.color = UIHelper.GetUIColor(itemConfig.ItemColor, true);
|
| | | m_EquipBehaviour.Init(betterModel, true);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c8eb21cc504d5514b950ab4d60ef9814 |
| | | timeCreated: 1534753740 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public class InGamePushContainer : MonoBehaviour
|
| | | {
|
| | | [SerializeField] BetterItemGetBehaviour m_BetterEquipPusher;
|
| | | [SerializeField] RealmBetterEquipBehaviour m_RealmBetterEquipPusher;
|
| | | [SerializeField] PreciousItemGetBehaviour m_PreciousItemPusher;
|
| | | [SerializeField] FindPreciousBossRebornBehaviour m_BossRebornPusher;
|
| | | [SerializeField] ItemUseBehaviour m_itemUsePusher;
|
| | |
| | |
|
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
|
| | | BetterEquipGetModel betterEquipGetModel { get { return ModelCenter.Instance.GetModel<BetterEquipGetModel>(); } }
|
| | | RealmBetterEquipModel realmEquipModel { get { return ModelCenter.Instance.GetModel<RealmBetterEquipModel>(); } }
|
| | | PreciousItemGetModel preciousItemGetModel { get { return ModelCenter.Instance.GetModel<PreciousItemGetModel>(); } }
|
| | | ItemUseModel itemUseModel { get { return ModelCenter.Instance.GetModel<ItemUseModel>(); } }
|
| | | ItemOverdueModel itemOverdue { get { return ModelCenter.Instance.GetModel<ItemOverdueModel>(); } }
|
| | |
| | | public void Init()
|
| | | {
|
| | | CheckBetterEquip();
|
| | | CheckRealmBetterEquip();
|
| | | CheckPreciousItem();
|
| | | CheckBossReborn();
|
| | | CheckItemUse();
|
| | |
| | | FirstChargeTrialShow();
|
| | | playerPack.RefreshDecomAttrAct += CheckEquipDecompose;
|
| | | betterEquipGetModel.showEquipRefreshEvent += CheckBetterEquip;
|
| | | realmEquipModel.showEquipRefreshEvent += CheckRealmBetterEquip;
|
| | | preciousItemGetModel.showItemRefreshEvent += CheckPreciousItem;
|
| | | findPreciousModel.bossRebornNotifyChangeEvent += CheckBossReborn;
|
| | | itemUseModel.showItemRefreshEvent += CheckItemUse;
|
| | |
| | | NewBieCenter.Instance.guideBeginEvent -= OnNewBieGuideBegin;
|
| | | guardModel.onDungeonEquipGuardEvent -= CheckDungeonGuard;
|
| | | firstTimeRechargeModel.IsTipShowEvent -= FirstChargeTrialShow;
|
| | | realmEquipModel.showEquipRefreshEvent -= CheckRealmBetterEquip;
|
| | | }
|
| | |
|
| | |
|
| | | private void CheckRealmBetterEquip()
|
| | | {
|
| | | if (string.IsNullOrEmpty(realmEquipModel.currentEquipGuid))
|
| | | {
|
| | | m_RealmBetterEquipPusher.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (betterEquipGetModel.ShowBetterEquipAble())
|
| | | {
|
| | | m_RealmBetterEquipPusher.gameObject.SetActive(true);
|
| | | m_RealmBetterEquipPusher.ShowBetterEquip();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_RealmBetterEquipPusher.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void CheckBetterEquip()
|
| | |
| | | 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>(); } }
|
| | |
|
| | | public event Action guideStepChangeEvent;
|
| | | public event Action guideBeginEvent;
|
| | |
| | | case GuideTriggerType.RealmSitDown:
|
| | | return false;
|
| | | case GuideTriggerType.ItemCompound:
|
| | | return composeModel.IsComposeTicketByType(config.Condition);
|
| | | if (DungeonSuppliesLackWin.lackType != DungeonSuppliesLackWin.LackType.FairyLand)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var itemId = composeModel.GetTicketId((int)ComposeFuncType.Ticket, config.Condition, 0);
|
| | | var singlepack = packModel.GetSinglePackModel(PackType.rptItem);
|
| | | var count = singlepack != null ? singlepack.GetItemCountByID(itemId) : 0;
|
| | | return composeModel.IsComposeTicketByType(config.Condition) && itemId != 0 && count == 0;
|
| | | case GuideTriggerType.HangUpResult:
|
| | | return true;
|
| | | case GuideTriggerType.BranchQuestCando:
|
| | |
| | | UIEffect uie = cell.transform.GetComponent<UIEffect>();
|
| | | if (petmodel.ListEffectSkill.Contains(curPetSkillIds[skillIdIndex]))
|
| | | {
|
| | | if (!uie.IsPlaying)
|
| | | {
|
| | | uie.Play();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (uie.IsPlaying)
|
| | | {
|
| | | uie.Stop();
|
| | | }
|
| | | uie.Play();
|
| | | |
| | | }
|
| | | if (petmodel._DicPetBack.ContainsKey(petInfoConfig.ID))
|
| | | {
|
| | |
| | | [SerializeField] RealmProgressBehaviour m_RealmProgress;
|
| | |
|
| | | [SerializeField] UIEffect m_RealmDungeonSfx;
|
| | | [SerializeField] UIEffect m_GetRealmPointSfx;
|
| | |
|
| | | [SerializeField] Button m_FuncButton;
|
| | | [SerializeField] Text m_FuncButtonTxt;
|
| | |
| | | [SerializeField, Header("模型位置")] Vector3[] m_ModelPositions;
|
| | | [SerializeField, Header("当前境界位置")] Vector3[] m_RealmNowPositions;
|
| | | [SerializeField, Header("下一境界位置")] Vector3[] m_RealmNextwPositions;
|
| | | [SerializeField, Header("Boss位置")] Vector3[] m_BossPositions;
|
| | | [SerializeField, Header("Boss出现延长")] float m_DelayEnterTime = 1f;
|
| | |
|
| | | int cacheRealmPoint = 0;
|
| | | Coroutine cacheCoroutine = null;
|
| | | RuntimeAnimatorController cacheController = null;
|
| | | const string State_EnterHash = "Show";
|
| | | const string State_IdleHash = "Idle";
|
| | |
|
| | | RealmModel realmModel { get { return ModelCenter.Instance.GetModel<RealmModel>(); } }
|
| | |
|
| | |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | WindowCenter.Instance.windowAfterCloseEvent += WindowAfterCloseEvent;
|
| | | cacheRealmPoint = PlayerDatas.Instance.extersion.realmPoint;
|
| | | m_RawBoss.gameObject.SetActive(false);
|
| | | m_RawPlayer.gameObject.SetActive(false);
|
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | if (realmModel.realmDungeonState)
|
| | | {
|
| | | StopBoss();
|
| | | m_RawBoss.gameObject.SetActive(false);
|
| | | m_RawPlayer.gameObject.SetActive(true);
|
| | | UI3DModelExhibition.Instance.BeginShowSitDownPlayer(m_RawPlayer, PlayerDatas.Instance.baseData.Job);
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | if (realmModel.realmDungeonState)
|
| | | {
|
| | | m_RealmDungeonSfx.Play();
|
| | | StartCoroutine(Co_DisplayBossShow());
|
| | | }
|
| | | realmModel.realmDungeonState = false;
|
| | | }
|
| | |
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | WindowCenter.Instance.windowAfterCloseEvent -= WindowAfterCloseEvent;
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | StopBoss();
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | realmModel.realmDungeonState = false;
|
| | | if (cacheCoroutine != null)
|
| | | {
|
| | | StopCoroutine(cacheCoroutine);
|
| | | cacheCoroutine = null;
|
| | | }
|
| | | if (cacheController != null)
|
| | | {
|
| | | cacheController = null;
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | IEnumerator Co_DisplayBossShow()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS800;
|
| | | ResetRunTimeController();
|
| | | var config = ConfigManager.Instance.GetTemplate<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
|
| | | m_RawPlayer.gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(m_DelayEnterTime > 0 ? m_DelayEnterTime : 1f);
|
| | | StartBoss(config, true);
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType)
|
| | | {
|
| | |
| | | DisplayModel();
|
| | | DisplayButton();
|
| | |
|
| | | if (PlayerDatas.Instance.extersion.realmPoint >= cacheRealmPoint)
|
| | | {
|
| | | DisplayGetRealmPointSfx();
|
| | | }
|
| | | cacheRealmPoint = PlayerDatas.Instance.extersion.realmPoint;
|
| | | }
|
| | | }
|
| | |
| | | if (realmModel.IsRealmHighest || _realmPoint < config.NeedPoint)
|
| | | {
|
| | | m_RawPlayer.gameObject.SetActive(true);
|
| | | StopBoss();
|
| | | m_RawBoss.gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | UI3DModelExhibition.Instance.BeginShowSitDownPlayer(m_RawPlayer, PlayerDatas.Instance.baseData.Job);
|
| | | }
|
| | | else if (_realmPoint >= config.NeedGood)
|
| | | {
|
| | | m_RawBoss.gameObject.SetActive(true);
|
| | | m_RawPlayer.gameObject.SetActive(false);
|
| | | ResetRunTimeController();
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(config.BossID, config.IsBigRealm == 1 ? Vector3.zero : direction, m_RawBoss, false);
|
| | | StartBoss(config);
|
| | | }
|
| | | }
|
| | |
|
| | | private void StopBoss()
|
| | | {
|
| | | ResetRunTimeController();
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | }
|
| | |
|
| | | private void ResetRunTimeController()
|
| | | {
|
| | | var npcModel = UI3DModelExhibition.Instance.NpcModelPet;
|
| | | if (npcModel != null)
|
| | | {
|
| | | var animator = npcModel.GetComponentInChildren<Animator>();
|
| | | if (animator != null && cacheController != null)
|
| | | {
|
| | | animator.runtimeAnimatorController = cacheController;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void StartBoss(RealmConfig config, bool act = false)
|
| | | {
|
| | | StopBoss();
|
| | | m_RawBoss.gameObject.SetActive(true);
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(config.BossID, config.IsBigRealm == 1 ? Vector3.zero : direction, m_RawBoss, false);
|
| | | var npcConfig = ConfigManager.Instance.GetTemplate<NPCConfig>(config.BossID);
|
| | | var npcModel = UI3DModelExhibition.Instance.NpcModelPet;
|
| | | m_RawBoss.transform.localPosition = config.IsBigRealm == 1 ? m_BossPositions[1] : m_BossPositions[0];
|
| | | if (npcModel != null)
|
| | | {
|
| | | var animator = npcModel.GetComponentInChildren<Animator>();
|
| | | if (animator != null)
|
| | | {
|
| | | cacheController = animator.runtimeAnimatorController;
|
| | | var runtimeController = AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerRealmSuffix, npcConfig.MODE);
|
| | | animator.runtimeAnimatorController = runtimeController;
|
| | | animator.Play(act ? State_EnterHash : State_IdleHash, 0);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | else
|
| | | {
|
| | | m_FuncButtonTxt.text = Language.Get("RealmWin_Bewrite_1");
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayGetRealmPointSfx()
|
| | | {
|
| | | if (m_GetRealmPointSfx != null)
|
| | | {
|
| | | m_GetRealmPointSfx.Play();
|
| | | }
|
| | | }
|
| | |
|
| 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; |
| | | |
| | | 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; }
|
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| 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;
|
| | |
| | | {
|
| | | 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; |
| | | }
|
| | |
|
| | |
| | | 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];
|
| | | if (IudetDogzEquipPlus == null)
|
| | | {
|
| | | godBeastClass.GodBeastLv = 0;
|
| | | godBeastClass.GodBeasProficiency = 0;
|
| | | }
|
| | | else
|
| | | {
|
| | | godBeastClass.GodBeastLv = IudetDogzEquipPlus[0];
|
| | | godBeastClass.GodBeasProficiency = IudetDogzEquipPlus[1];
|
| | | } |
| | | godBeastClass.LocationMarker= key*10+ itemModel[i].EquipPlace;
|
| | | 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 = 0; j < DeleteIndexList.Count; j++)
|
| | | {
|
| | | GodBeastBagList.RemoveAt(DeleteIndexList[j]);
|
| | | }
|
| | | 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.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);
|
| | | }
|
| | | });
|
| | | |
| | | }
|
| | | }
|
| | | } |
| | |
| | | RegisterModel<ActivityModel>();
|
| | | RegisterModel<PlayerDeadModel>();
|
| | | RegisterModel<BetterEquipGetModel>();
|
| | | RegisterModel<RealmBetterEquipModel>();
|
| | | RegisterModel<PreciousItemGetModel>();
|
| | | RegisterModel<PlayerMainDate>();
|
| | | RegisterModel<StoryMissionsModel>();
|
| | |
| | | using EnhancedUI.EnhancedScroller; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class SortTable : MonoBehaviour |
| | | { |
| | | [SerializeField] SortType m_SortType; |
| | | public SortType sortType |
| | | { |
| | | get |
| | | { |
| | | return m_SortType; |
| | | } |
| | | set |
| | | { |
| | | m_SortType = value; |
| | | } |
| | | } |
| | | [SerializeField] List<SortElement> m_SortElements; |
| | | [SerializeField] ScrollerController m_Controller; |
| | | [SerializeField] ClickScreenOtherSpace m_ClickOtherSpace; |
| | | [SerializeField] Text m_TargetDisplay; |
| | | public event Action<int> onSelectSortEvent; |
| | | public event Action onSortCloseEvent; |
| | | |
| | | DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } } |
| | | private void Awake() |
| | | { |
| | | m_Controller.OnRefreshCell += OnRefreshCell; |
| | | } |
| | | |
| | | private void OnEnable() |
| | | { |
| | | m_Controller.Refresh(); |
| | | if (m_SortElements != null) |
| | | { |
| | | for (int i = 0; i < m_SortElements.Count; i++) |
| | | { |
| | | m_Controller.AddCell(ScrollerDataType.Header, i, OnSortSelect); |
| | | } |
| | | } |
| | | m_Controller.Restart(); |
| | | |
| | | if (m_ClickOtherSpace != null) |
| | | { |
| | | m_ClickOtherSpace.RemoveAllListeners(); |
| | | m_ClickOtherSpace.AddListener(() => |
| | | { |
| | | if (onSortCloseEvent != null) |
| | | { |
| | | onSortCloseEvent(); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | private void OnSortSelect(CellView _cell) |
| | | { |
| | | var _index = _cell.index; |
| | | var type = m_SortElements[_index].type; |
| | | using EnhancedUI.EnhancedScroller;
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class SortTable : MonoBehaviour
|
| | | {
|
| | | [SerializeField] SortType m_SortType;
|
| | | public SortType sortType
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_SortType;
|
| | | }
|
| | | set
|
| | | {
|
| | | m_SortType = value;
|
| | | }
|
| | | }
|
| | | [SerializeField] List<SortElement> m_SortElements;
|
| | | [SerializeField] ScrollerController m_Controller;
|
| | | [SerializeField] ClickScreenOtherSpace m_ClickOtherSpace;
|
| | | [SerializeField] Text m_TargetDisplay;
|
| | | public event Action<int> onSelectSortEvent;
|
| | | public event Action onSortCloseEvent;
|
| | |
|
| | | DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
|
| | | private void Awake()
|
| | | {
|
| | | m_Controller.OnRefreshCell += OnRefreshCell;
|
| | | }
|
| | |
|
| | | private void OnEnable()
|
| | | {
|
| | | m_Controller.Refresh();
|
| | | if (m_SortElements != null)
|
| | | {
|
| | | for (int i = 0; i < m_SortElements.Count; i++)
|
| | | {
|
| | | m_Controller.AddCell(ScrollerDataType.Header, i, OnSortSelect);
|
| | | }
|
| | | }
|
| | | m_Controller.Restart();
|
| | |
|
| | | if (m_ClickOtherSpace != null)
|
| | | {
|
| | | m_ClickOtherSpace.RemoveAllListeners();
|
| | | m_ClickOtherSpace.AddListener(() =>
|
| | | {
|
| | | if (onSortCloseEvent != null)
|
| | | {
|
| | | onSortCloseEvent();
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | private void OnSortSelect(CellView _cell)
|
| | | {
|
| | | var _index = _cell.index;
|
| | | var type = m_SortElements[_index].type;
|
| | | switch (sortType)
|
| | | {
|
| | | case SortType.EquipQuality:
|
| | |
| | | case SortType.EquipStar:
|
| | | dogzModel.SelectDogzItemStart = type;
|
| | | break;
|
| | | } |
| | | |
| | | if (onSelectSortEvent != null) |
| | | { |
| | | onSelectSortEvent(type); |
| | | } |
| | | if (onSortCloseEvent != null) |
| | | { |
| | | onSortCloseEvent(); |
| | | } |
| | | if (m_TargetDisplay != null) |
| | | { |
| | | m_TargetDisplay.text = Language.Get(m_SortElements[_index].textKey); |
| | | } |
| | | this.gameObject.SetActive(false); |
| | | } |
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _sortCell = cell as SortCell; |
| | | _sortCell.sortTypeTxt.text = Language.Get(m_SortElements[cell.index].textKey); |
| | | } |
| | | |
| | | public void SetDefault() |
| | | { |
| | | if (m_TargetDisplay != null && m_SortElements != null && m_SortElements.Count > 0) |
| | | { |
| | | m_TargetDisplay.text = Language.Get(m_SortElements[0].textKey); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public enum SortType |
| | | { |
| | | EquipQuality, |
| | | EquipStar, |
| | | } |
| | | [Serializable] |
| | | public struct SortElement |
| | | { |
| | | [Header("语言表key")] |
| | | public string textKey; |
| | | public int type; |
| | | } |
| | | } |
| | | |
| | | }
|
| | |
|
| | | if (onSelectSortEvent != null)
|
| | | {
|
| | | onSelectSortEvent(type);
|
| | | }
|
| | | if (onSortCloseEvent != null)
|
| | | {
|
| | | onSortCloseEvent();
|
| | | }
|
| | | if (m_TargetDisplay != null)
|
| | | {
|
| | | m_TargetDisplay.text = Language.Get(m_SortElements[_index].textKey);
|
| | | }
|
| | | this.gameObject.SetActive(false);
|
| | | }
|
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var _sortCell = cell as SortCell;
|
| | | _sortCell.sortTypeTxt.text = Language.Get(m_SortElements[cell.index].textKey);
|
| | | }
|
| | |
|
| | | public void SetDefault()
|
| | | {
|
| | | if (m_TargetDisplay != null && m_SortElements != null && m_SortElements.Count > 0)
|
| | | {
|
| | | m_TargetDisplay.text = Language.Get(m_SortElements[0].textKey);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public enum SortType
|
| | | {
|
| | | EquipQuality,
|
| | | EquipStar,
|
| | | }
|
| | | [Serializable]
|
| | | public struct SortElement
|
| | | {
|
| | | [Header("语言表key")]
|
| | | public string textKey;
|
| | | public int type;
|
| | | }
|
| | | }
|
| | |
|