| | |
| | | [SerializeField] UIEffect m_UIEffect1C;
|
| | |
|
| | | EquipStrengthModel model { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } }
|
| | | EquipGemModel equipGemModel { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } }
|
| | | EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | EquipStarModel equipStarModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } }
|
| | |
| | | private bool IsAutomaticBool = false;
|
| | | private float WaitTime = 0.1f;
|
| | | private float Times = 0f;
|
| | |
|
| | | List<int> m_Sorts = new List<int>();
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | }
|
| | | if (equipSet.unLocked)
|
| | | {
|
| | | var slotCount = equipGemModel.GetUnlockEquipSlotCount(level);
|
| | | if (slotCount > 0)
|
| | | jumpIndex++;
|
| | | if (model.SelectLevel == level)
|
| | | {
|
| | | jumpIndex++;
|
| | | if (equipGemModel.selectLevel == level)
|
| | | foreach (var place in m_Sorts)
|
| | | {
|
| | | var places = equipGemModel.GetMosaicEquipPlaces();
|
| | | foreach (var place in places)
|
| | | if (equipSet.IsSlotUnLocked(place))
|
| | | {
|
| | | if (equipSet.IsSlotUnLocked(place))
|
| | | if (selectLevel == level && selectPlace == place)
|
| | | {
|
| | | if (selectLevel == level && selectPlace == place)
|
| | | {
|
| | | return jumpIndex;
|
| | | }
|
| | | jumpIndex++;
|
| | | return jumpIndex;
|
| | | }
|
| | | jumpIndex++;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | if (equipSet.unLocked)
|
| | | {
|
| | | var slotCount = equipGemModel.GetUnlockEquipSlotCount(level);
|
| | | if (slotCount > 0)
|
| | | m_Sorts.Clear();
|
| | | m_Controller.AddCell(ScrollerDataType.Header, level);
|
| | | if (model.SelectLevel == level)
|
| | | {
|
| | | m_Controller.AddCell(ScrollerDataType.Header, level);
|
| | | if (model.SelectLevel == level)
|
| | | m_Sorts.AddRange(model.equipPlaces);
|
| | | m_Sorts.Sort(EquipCompare);
|
| | | foreach (var place in m_Sorts)
|
| | | {
|
| | | var places = equipGemModel.GetMosaicEquipPlaces();
|
| | | foreach (var place in places)
|
| | | if (equipSet.IsSlotUnLocked(place))
|
| | | {
|
| | | if (equipSet.IsSlotUnLocked(place))
|
| | | {
|
| | | m_Controller.AddCell(ScrollerDataType.Normal, level * 1000 + place);
|
| | | }
|
| | | m_Controller.AddCell(ScrollerDataType.Normal, level * 1000 + place);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | m_Controller.Restart();
|
| | | }
|
| | |
|
| | | private int EquipCompare(int x, int y)
|
| | | {
|
| | | var x_state = model.GetEquipStrengthState(new Int2(model.SelectLevel, x));
|
| | | var y_state = model.GetEquipStrengthState(new Int2(model.SelectLevel, y));
|
| | | if (x_state != y_state)
|
| | | {
|
| | | return x_state.CompareTo(y_state);
|
| | | }
|
| | | return x.CompareTo(y);
|
| | | }
|
| | |
|
| | | private void SelectEquipRefresh()
|
| | | {
|
| | | m_Controller.m_Scorller.RefreshActiveCellViews();
|
| | |
| | | m_ContainerStrength.gameObject.SetActive(false);
|
| | | return;
|
| | | }
|
| | |
|
| | | m_ContainerEmpty.gameObject.SetActive(false);
|
| | | m_ContainerStrength.gameObject.SetActive(true);
|
| | |
|
| | | m_NotEquipped.SetActive(false);
|
| | | m_EquipStrengthFull.gameObject.SetActive(false);
|
| | | m_EquipStrengthUpper.gameObject.SetActive(false);
|
| | | m_EquipStrengthRein.gameObject.SetActive(false);
|
| | | m_EquipEvolution.gameObject.SetActive(false);
|
| | | int equipLevel = model.SelectLevel;
|
| | | int equipPlace = model.SelectEquipPlace;
|
| | | var equipSet = equipModel.GetEquipSet(equipLevel);
|
| | | string equipGuid = string.Empty;
|
| | | equipGuid = equipSet.GetEquip(equipPlace);
|
| | | var equiped = !string.IsNullOrEmpty(equipGuid);
|
| | | if (equiped)
|
| | | var equipGuid = equipModel.GetEquip(new Int2(model.SelectLevel, model.SelectEquipPlace));
|
| | |
|
| | | var state = model.GetEquipStrengthState(new Int2(model.SelectLevel, model.SelectEquipPlace));
|
| | |
|
| | | m_NotEquipped.SetActive(state == 3);
|
| | |
|
| | | m_EquipStrengthFull.gameObject.SetActive(state == 2);
|
| | | m_EquipStrengthUpper.gameObject.SetActive(state == 1);
|
| | | m_EquipStrengthRein.gameObject.SetActive(state == 0);
|
| | | m_EquipEvolution.gameObject.SetActive(state != 3);
|
| | | m_BottomFrame.gameObject.SetActive(state == 1 || state == 0);
|
| | |
|
| | | if (state != 3)
|
| | | {
|
| | | int equipIndex = EquipPlaceMapConfig.GetServerPlace(equipLevel, equipPlace);
|
| | | var item = packModel.GetItemByGuid(equipGuid);
|
| | | var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, equipLevel);
|
| | |
|
| | | int star = Mathf.Min(maxStar, equipStarModel.GetStarLevel(new Int2(equipLevel, equipPlace)));
|
| | |
|
| | | int equipLv = 0;
|
| | | int advancedLv = 0;
|
| | | if (model.EquipStrengthDic.ContainsKey(equipIndex))//获取当前强化等级
|
| | | var advancedLv = 0;
|
| | | var serverPlace = EquipPlaceMapConfig.GetServerPlace(model.SelectLevel, model.SelectEquipPlace);
|
| | | if (model.EquipStrengthDic.ContainsKey(serverPlace))
|
| | | {
|
| | | equipLv = model.EquipStrengthDic[equipIndex].StrengthLevel;
|
| | | advancedLv = model.EquipStrengthDic[equipIndex].EvolveLV;
|
| | | advancedLv = model.EquipStrengthDic[serverPlace].EvolveLV;
|
| | | }
|
| | |
|
| | | int equipType = EquipStrengthModel.GetEquipStrengthType(equipPlace);
|
| | | var itemPlusMaxConfig = ItemPlusMaxConfig.GetEquipTypeAndEquipStar(equipType, star);//获取强化等级上限值
|
| | | if (itemPlusMaxConfig == null)
|
| | | {
|
| | | DebugEx.LogError("未查找到表数据");
|
| | | return;
|
| | | }
|
| | |
|
| | | int maxLv = model.GetEquipLevelMax(equipType, maxStar);//获取最大强化等级
|
| | | m_EquipEvolution.gameObject.SetActive(true);
|
| | | m_EquipEvolution.SetEquipEvolution(equipPlace, advancedLv);
|
| | | if (equipLv >= maxLv)//满级
|
| | | {
|
| | | m_BottomFrame.SetActive(false);
|
| | | m_EquipStrengthFull.gameObject.SetActive(true);
|
| | | m_EquipStrengthFull.SetEquipStrengthFull(equipGuid, equipLevel, equipPlace);
|
| | | }
|
| | | else if (maxLv > equipLv && equipLv >= itemPlusMaxConfig.levelMax)//强化上限
|
| | | {
|
| | | m_BottomFrame.SetActive(true);
|
| | | m_EquipStrengthUpper.gameObject.SetActive(true);
|
| | | m_EquipStrengthUpper.SetEquipStrengthUpper(equipGuid, equipLevel, equipPlace);
|
| | | }
|
| | | else if (itemPlusMaxConfig.levelMax > equipLv)//可强化过
|
| | | {
|
| | | m_BottomFrame.SetActive(true);
|
| | | m_EquipStrengthRein.gameObject.SetActive(true);
|
| | | m_EquipStrengthRein.SetEquipStrengthRein(equipGuid, equipLevel, equipPlace);
|
| | | }
|
| | | m_EquipEvolution.SetEquipEvolution(model.SelectEquipPlace, advancedLv);
|
| | | }
|
| | | else
|
| | |
|
| | | switch (state)
|
| | | {
|
| | | m_BottomFrame.SetActive(false);
|
| | | m_NotEquipped.SetActive(true);
|
| | | case 0:
|
| | | m_EquipStrengthRein.SetEquipStrengthRein(equipGuid, model.SelectLevel, model.SelectEquipPlace);
|
| | | break;
|
| | | case 1:
|
| | | m_EquipStrengthUpper.SetEquipStrengthUpper(equipGuid, model.SelectLevel, model.SelectEquipPlace);
|
| | | break;
|
| | | case 2:
|
| | | m_EquipStrengthFull.SetEquipStrengthFull(equipGuid, model.SelectLevel, model.SelectEquipPlace);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | if (equipSet.unLocked)
|
| | | {
|
| | | var slotCount = equipGemModel.GetUnlockEquipSlotCount(level);
|
| | | if (slotCount > 0)
|
| | | if (model.SelectLevel == -1)
|
| | | {
|
| | | if (model.SelectLevel == -1)
|
| | | model.SelectLevel = level;
|
| | | }
|
| | | if (model.SelectLevel == level)
|
| | | {
|
| | | var places = model.equipPlaces;
|
| | | foreach (var place in places)
|
| | | {
|
| | | model.SelectLevel = level;
|
| | | }
|
| | | if (model.SelectLevel == level)
|
| | | {
|
| | | var places = equipGemModel.GetMosaicEquipPlaces();
|
| | | foreach (var place in places)
|
| | | if (model.SelectEquipPlace == -1)
|
| | | {
|
| | | if (model.SelectEquipPlace == -1)
|
| | | {
|
| | | model.SelectEquipPlace = place;
|
| | | }
|
| | | model.SelectEquipPlace = place;
|
| | | }
|
| | | }
|
| | | }
|