Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | private void RequestSfx()
|
| | | {
|
| | | RecycleSfx();
|
| | | if (base.itemConfig == null)
|
| | | var config = ItemConfig.Get(itemId);
|
| | | if (config != null)
|
| | | {
|
| | | return;
|
| | | var effect = config.ItemColor == 3 ? 1136 :
|
| | | config.ItemColor == 4 ? 1137 :
|
| | | config.ItemColor == 5 ? 1138 : 0;
|
| | | if (effect != 0)
|
| | | {
|
| | | itemColorSfx = EffectMgr.Instance.PlayUIEffect(effect, 2500, transform, true);
|
| | | }
|
| | | }
|
| | | var _effect = itemConfig.ItemColor == 3 ? 1136 :
|
| | | itemConfig.ItemColor == 4 ? 1137 :
|
| | | itemConfig.ItemColor == 5 ? 1138 : 0;
|
| | | if (_effect != 0)
|
| | | {
|
| | | itemColorSfx = EffectMgr.Instance.PlayUIEffect(_effect, 2500, transform, true);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void RecycleSfx()
|
| | |
| | | { |
| | | foreach (var item in items) |
| | | { |
| | | if (!item.isAuction) |
| | | if (ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId) && !item.isAuction) |
| | | { |
| | | candidateEquips.Add(new CandidateEquip(item.guid)); |
| | | } |
| | |
| | | [Header("闪烁次数")]
|
| | | [SerializeField] public int flashingTimes = 10;
|
| | | [Header("单次闪烁时间")]
|
| | | [SerializeField] public float flashingTime = 0.2f;
|
| | | [SerializeField] public float flashingTime = 0.2f;
|
| | | [Header("得到物品停留时间")]
|
| | | [SerializeField] float stopTime = 2f;
|
| | | [Header("寻宝得到物品动画时间")]
|
| | |
| | | {
|
| | | xbItemlist.Clear();
|
| | | int length = horTopContent.childCount;
|
| | | for(int i = 0; i < length; i++)
|
| | | for (int i = 0; i < length; i++)
|
| | | {
|
| | | XBItemCell xbItem = horTopContent.GetChild(i).GetComponent<XBItemCell>();
|
| | | xbItemlist.Add(xbItem);
|
| | |
| | | xbItemlist.Add(xbItem);
|
| | | }
|
| | | length = horBottomContent.childCount;
|
| | | for (int i = length - 1; i > - 1; i--)
|
| | | for (int i = length - 1; i > -1; i--)
|
| | | {
|
| | | XBItemCell xbItem = horBottomContent.GetChild(i).GetComponent<XBItemCell>();
|
| | | xbItemlist.Add(xbItem);
|
| | |
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | base.LateUpdate();
|
| | | if(IsStartPlayAudio)
|
| | | if (IsStartPlayAudio)
|
| | | {
|
| | | if(playeAudioTime <= 0)
|
| | | if (playeAudioTime <= 0)
|
| | | {
|
| | | SoundPlayer.Instance.PlayUIAudio(66);
|
| | | }
|
| | | playeAudioTime += Time.deltaTime;
|
| | | if(playeAudioTime > minPlayeAudioTime)
|
| | | if (playeAudioTime > minPlayeAudioTime)
|
| | | {
|
| | | playeAudioTime = 0;
|
| | | IsStartPlayAudio = false;
|
| | |
| | |
|
| | | private void RefreshSecond()
|
| | | {
|
| | | if(XBModel.isXBCoolTime)
|
| | | if (XBModel.isXBCoolTime)
|
| | | {
|
| | | coolTime -= 1;
|
| | | if(coolTime < 0)
|
| | | if (coolTime < 0)
|
| | | {
|
| | | XBModel.isXBCoolTime = false;
|
| | | ResetXBItemState();
|
| | |
| | |
|
| | | private void InitUI()
|
| | | {
|
| | | for(int i = 0; i < xbItemlist.Count;i++)
|
| | | for (int i = 0; i < xbItemlist.Count; i++)
|
| | | {
|
| | | if(getItemlist.Count > i)
|
| | | if (getItemlist.Count > i)
|
| | | {
|
| | | xbItemlist[i].gameObject.SetActive(true);
|
| | | xbItemlist[i].SetModel(getItemlist[i].itemId, getItemlist[i].count, getItemlist[i].gridIndex);
|
| | |
| | | {
|
| | | xbItemlist[i].gameObject.SetActive(false);
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | playeAudioTime = 0;
|
| | |
| | | xbResultObj.SetActive(false);
|
| | | freeXbBtn.gameObject.SetActive(false);
|
| | | funcSet = XBModel.GetXBFuncSet(1);
|
| | | if(funcSet != null)
|
| | | if (funcSet != null)
|
| | | {
|
| | | xbBtnText.text = Language.Get("HappyXB101", funcSet.xbNums[0]);
|
| | | xbManyBtnText.text = Language.Get("HappyXB101", funcSet.xbNums[1]);
|
| | |
| | | xbManyDesText.text = Language.Get("HappyXB106", funcSet.costToolNums[1]);
|
| | | ItemConfig itemConfig1 = ItemConfig.Get(funcSet.costToolIds[0]);
|
| | | ItemConfig itemConfig2 = ItemConfig.Get(funcSet.costToolIds[1]);
|
| | | if(itemConfig1 != null)
|
| | | if (itemConfig1 != null)
|
| | | {
|
| | | toolImg1.SetSprite(itemConfig1.IconKey);
|
| | | }
|
| | |
| | |
|
| | | private void RefreshFreeTime(float time)
|
| | | {
|
| | | if(isHaveFreeTime)
|
| | | if (isHaveFreeTime)
|
| | | {
|
| | | if (XBModel.IsHaveFreeXB(1))
|
| | | {
|
| | |
| | | {
|
| | | freeXBTimeText.gameObject.SetActive(false);
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | private void RefreshSkipUI()
|
| | |
| | | {
|
| | | int xbToolCnt = 0;
|
| | | int needToolCnt = 0;
|
| | | if (XBModel.IsHaveManyXBTool(1,out xbToolCnt,out needToolCnt))
|
| | | if (XBModel.IsHaveManyXBTool(1, out xbToolCnt, out needToolCnt))
|
| | | {
|
| | | toolXBShowObj.SetActive(true);
|
| | | toolNumText.text = StringUtility.Contact("x", xbToolCnt);
|
| | |
| | | bool isXBMany = false;
|
| | | private void ClickXBManyBtn()
|
| | | {
|
| | | XBModel.SendXBManyQuest(PackType.Treasure,1);
|
| | | XBModel.SendXBManyQuest(PackType.Treasure, 1);
|
| | | }
|
| | |
|
| | | private void OnStartXB(int oneOrMany)
|
| | | {
|
| | | if(oneOrMany == 0)
|
| | | if (oneOrMany == 0)
|
| | | {
|
| | | maskObj.SetActive(true);
|
| | | isXBMany = false;
|
| | |
| | | maskObj.SetActive(true);
|
| | | isXBMany = true;
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | private void ClickFreeXbBtn()
|
| | |
| | |
|
| | | private void RefreshXBResult()
|
| | | {
|
| | | if(XBModel.isJumpBestXB)
|
| | | if (XBModel.isJumpBestXB)
|
| | | {
|
| | | ResetXBItemState();
|
| | | WindowCenter.Instance.Open<HappyXBGetItemWin>();
|
| | |
| | | if (index < xbResultItemBasiclist.Count)
|
| | | {
|
| | | xbResultItemBasiclist[index].gameObject.SetActive(true);
|
| | | xbResultItemBasiclist[index].transform.DOScale(new Vector3(1, 1, 1), scaleTime).OnComplete(()=>
|
| | | xbResultItemBasiclist[index].transform.DOScale(new Vector3(1, 1, 1), scaleTime).OnComplete(() =>
|
| | | {
|
| | | if (index == xbResultItemBasiclist.Count - 1)
|
| | | {
|
| | |
| | | WindowCenter.Instance.Open<HappyXBGetItemWin>();
|
| | | }
|
| | | });
|
| | | if (xbResultItemBasiclist[index].itemConfig != null)
|
| | | {
|
| | | XBModel.GetNotifyResult(xbResultItemBasiclist[index].itemConfig.ID, int.Parse(xbResultItemBasiclist[index].countText.text));
|
| | | }
|
| | |
|
| | | XBModel.GetNotifyResult(xbResultItemBasiclist[index].itemId, int.Parse(xbResultItemBasiclist[index].countText.text));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator PlayXBAni(int targetIndex,int curSelectIndex)
|
| | | IEnumerator PlayXBAni(int targetIndex, int curSelectIndex)
|
| | | {
|
| | | int cycle = 1;
|
| | | float xbSpeed1 = startDelayTime;
|
| | |
| | | IsStartPlayAudio = true;
|
| | | curSelectIndex += 1;
|
| | | curSelectIndex %= xbItemlist.Count;
|
| | | if(curSelectIndex <= 0)
|
| | | if (curSelectIndex <= 0)
|
| | | {
|
| | | curSelectIndex = xbItemlist.Count;
|
| | | }
|
| | |
| | |
|
| | | int remainIndex = targetIndexs[targetIndex].gridIndex - curSelectIndex;
|
| | |
|
| | | if(remainIndex < 0)
|
| | | if (remainIndex < 0)
|
| | | {
|
| | | remainIndex = xbItemlist.Count + remainIndex;
|
| | | }
|
| | |
| | | {
|
| | | for (int i = 0; i < xbItemlist.Count; i++)
|
| | | {
|
| | | xbItemlist[i].CheckToFlashing(1,curSelectIndex);
|
| | | xbItemlist[i].CheckToFlashing(1, curSelectIndex);
|
| | | }
|
| | | for (int i = 0; i < xbItemlist.Count; i++)
|
| | | {
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | |
| | | StartCoroutine(PlaySelectItemAni(false,targetIndex,curSelectIndex));
|
| | |
|
| | | StartCoroutine(PlaySelectItemAni(false, targetIndex, curSelectIndex));
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | }
|
| | | cycle += 1;
|
| | | }
|
| | | |
| | | switch(targetIndex)
|
| | |
|
| | | switch (targetIndex)
|
| | | {
|
| | | case 0:
|
| | | xbSpeed1 -= xbA1 * 0.05f;
|
| | |
| | | yield return new WaitForSeconds(xbSpeed1);
|
| | | break;
|
| | | case 9:
|
| | | if(cycle > cycleTimes && remainIndex <= 4)
|
| | | if (cycle > cycleTimes && remainIndex <= 4)
|
| | | {
|
| | | xbSpeed2 += XbA2 * 0.05f;
|
| | | if (xbSpeed2 >= maxTimeInter)
|
| | |
| | | yield return new WaitForSeconds(xbSpeed3);
|
| | | break;
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator PlaySelectItemAni(bool isEndXB,int targetIndex = 0,int curSelectIndex = 0)
|
| | | IEnumerator PlaySelectItemAni(bool isEndXB, int targetIndex = 0, int curSelectIndex = 0)
|
| | | {
|
| | | XBGetItemConfig getItemConfig = XBModel.GetXBItemConfigByType(1);
|
| | | if(getItemConfig != null && getItemConfig.LuckyGridNum == curSelectIndex)
|
| | | if (getItemConfig != null && getItemConfig.LuckyGridNum == curSelectIndex)
|
| | | {
|
| | | yield return new WaitForSeconds(flashingTime*flashingTimes);
|
| | | yield return new WaitForSeconds(flashingTime * flashingTimes);
|
| | | }
|
| | | else
|
| | | {
|
| | | yield return new WaitForSeconds(stopTime);
|
| | | }
|
| | | |
| | | if(isEndXB)
|
| | |
|
| | | if (isEndXB)
|
| | | {
|
| | | if (targetIndexs.Count > 1)
|
| | | {
|
| | |
| | | {
|
| | | xbItemlist.Clear();
|
| | | int length = horTopContent.childCount;
|
| | | for(int i = 0; i < length; i++)
|
| | | for (int i = 0; i < length; i++)
|
| | | {
|
| | | XBItemCell xbItem = horTopContent.GetChild(i).GetComponent<XBItemCell>();
|
| | | xbItemlist.Add(xbItem);
|
| | |
| | | xbItemlist.Add(xbItem);
|
| | | }
|
| | | length = horBottomContent.childCount;
|
| | | for (int i = length - 1; i > - 1; i--)
|
| | | for (int i = length - 1; i > -1; i--)
|
| | | {
|
| | | XBItemCell xbItem = horBottomContent.GetChild(i).GetComponent<XBItemCell>();
|
| | | xbItemlist.Add(xbItem);
|
| | |
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | | protected override void LateUpdate()
|
| | | {
|
| | |
| | |
|
| | | private void InitUI()
|
| | | {
|
| | | |
| | | for (int i = 0; i < xbItemlist.Count;i++)
|
| | |
|
| | | for (int i = 0; i < xbItemlist.Count; i++)
|
| | | {
|
| | | if(getItemlist.Count > i)
|
| | | if (getItemlist.Count > i)
|
| | | {
|
| | | xbItemlist[i].gameObject.SetActive(true);
|
| | | xbItemlist[i].SetModel(getItemlist[i].itemId, getItemlist[i].count, getItemlist[i].gridIndex);
|
| | |
| | | {
|
| | | xbItemlist[i].gameObject.SetActive(false);
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | playeAudioTime = 0;
|
| | | IsStartPlayAudio = false;
|
| | |
| | | xbResultObj.SetActive(false);
|
| | | freeXbBtn.gameObject.SetActive(false);
|
| | | funcSet = XBModel.GetXBFuncSet(2);
|
| | | if(funcSet != null)
|
| | | if (funcSet != null)
|
| | | {
|
| | | xbBtnText.text = Language.Get("HappyXB101", funcSet.xbNums[0]);
|
| | | xbManyBtnText.text = Language.Get("HappyXB101", funcSet.xbNums[1]);
|
| | |
| | |
|
| | | private void RefreshFreeTime(float time)
|
| | | {
|
| | | if(isHaveFreeTime)
|
| | | if (isHaveFreeTime)
|
| | | {
|
| | | if (XBModel.IsHaveFreeXB(2))
|
| | | {
|
| | |
| | | {
|
| | | freeXBTimeText.gameObject.SetActive(false);
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | private void RefreshSkipUI()
|
| | |
| | | {
|
| | | int xbToolCnt = 0;
|
| | | int needToolCnt = 0;
|
| | | if (XBModel.IsHaveManyXBTool(2, out xbToolCnt,out needToolCnt))
|
| | | if (XBModel.IsHaveManyXBTool(2, out xbToolCnt, out needToolCnt))
|
| | | {
|
| | | toolXBShowObj.SetActive(true);
|
| | | toolNumText.text = StringUtility.Contact("x", xbToolCnt);
|
| | |
| | | ResetXBItemState();
|
| | | WindowCenter.Instance.Open<HappyXBGetItemWin>();
|
| | | }
|
| | | }); ;
|
| | | if(xbResultItemBasiclist[index].itemConfig != null)
|
| | | {
|
| | | XBModel.GetNotifyResult(xbResultItemBasiclist[index].itemConfig.ID, int.Parse(xbResultItemBasiclist[index].countText.text));
|
| | | }
|
| | | });
|
| | |
|
| | | XBModel.GetNotifyResult(xbResultItemBasiclist[index].itemId, int.Parse(xbResultItemBasiclist[index].countText.text));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (effect != null)
|
| | | {
|
| | | if (itemConfig != null)
|
| | | var config = ItemConfig.Get(itemId);
|
| | | if (config != null)
|
| | | {
|
| | | switch ((TextColType)itemConfig.ItemColor)
|
| | | switch ((TextColType)config.ItemColor)
|
| | | {
|
| | | case TextColType.Purple:
|
| | | effect.effect = 1136;
|
| | |
| | | item.transform.localScale = Vector3.one; |
| | | item.name = StringUtility.Contact("RewardCell", id); |
| | | item.gameObject.SetActive(true); |
| | | item.InitModel(heavenModel.campVicRewardDict[id], id); |
| | | item.InitModel(heavenModel.campVicRewardDict[id]); |
| | | GetList.Add(item); |
| | | item.button.RemoveAllListeners(); |
| | | item.button.AddListener(() => |
| | |
| | | item.transform.localScale = Vector3.one; |
| | | item.name = StringUtility.Contact("RewardCell", id); |
| | | item.gameObject.SetActive(true); |
| | | item.InitModel(heavenModel.campFailRewardDict[id], id); |
| | | item.InitModel(heavenModel.campFailRewardDict[id]); |
| | | GetList.Add(item); |
| | | item.button.RemoveAllListeners(); |
| | | item.button.AddListener(() => |
| | |
| | | public bool IsJobCompatibleItem(int itemId) |
| | | { |
| | | var config = ItemConfig.Get(itemId); |
| | | return config.JobLimit == 0 || config.JobLimit / 100 == PlayerDatas.Instance.baseData.Job; |
| | | return config != null && (config.JobLimit == 0 || config.JobLimit / 100 == PlayerDatas.Instance.baseData.Job); |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | [SerializeField] GameObject chooseImage; |
| | | [SerializeField] Text nameText; |
| | | public int ItemId = 0; |
| | | private void Awake() |
| | | { |
| | | ChooseItemWin.RefreshChooseCellAct += RefreshChooseImage; |
| | | |
| | | } |
| | | |
| | | public void InitModel(ItemCellModel model,int id) |
| | | public void InitModel(ItemCellModel model) |
| | | { |
| | | base.Init(model); |
| | | this.ItemId = id; |
| | | nameText.text = itemConfig.ItemName; |
| | | var config = ItemConfig.Get( itemId); |
| | | nameText.text = config.ItemName; |
| | | SetIsChoose(false); |
| | | |
| | | } |
| | | |
| | | private void RefreshChooseImage(int id) |
| | | { |
| | | if (id == ItemId) |
| | | if (id == this.itemId) |
| | | { |
| | | SetIsChoose(true); |
| | | } |
| | |
| | | }
|
| | | }
|
| | |
|
| | | public ItemConfig itemConfig;
|
| | | public int itemId { get; private set; }
|
| | |
|
| | | protected PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// </summary>
|
| | | /// <param name="model"></param>
|
| | | /// <param name="isCompare"></param>
|
| | | public virtual void Init(ItemModel model, bool isCompare = false, int compareScore = 0)
|
| | | public virtual void Init(ItemModel model, bool isCompare = false)
|
| | | {
|
| | | itemConfig = model.config;
|
| | | InitUI(model.guid, model.itemId, (ulong)model.count, model.equipScore, model.isAuction, model.packType, isCompare, model.useDataDict, compareScore);
|
| | | itemId = model.itemId;
|
| | | InitUI(model.guid, model.itemId, (ulong)model.count, model.equipScore, model.isAuction, model.packType, isCompare, model.useDataDict);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化数据(预览)
|
| | | /// </summary>
|
| | | /// <param name="model"></param>
|
| | | public virtual void Init(ItemCellModel model, int compareScore = 0)
|
| | | public virtual void Init(ItemCellModel model)
|
| | | {
|
| | | itemConfig = model.itemConfig;
|
| | | InitUI(model.guid, model.itemId, model.count, model.score, false, model.packType, model.isCompare, model.useDataDic, compareScore);
|
| | | itemId = model.itemId;
|
| | | InitUI(model.guid, model.itemId, model.count, model.score, false, model.packType, model.isCompare, model.useDataDic);
|
| | | }
|
| | |
|
| | | private void InitUI(string guid, int itemId, ulong count, int score, bool isAuction, PackType type, bool isCompare, Dictionary<int, List<int>> useDataDic, int compareScore = 0)
|
| | | private void InitUI(string guid, int itemId, ulong count, int score, bool isAuction, PackType type, bool isCompare, Dictionary<int, List<int>> useDataDic)
|
| | | {
|
| | | if (itemConfig == null) return;
|
| | | var config = ItemConfig.Get(itemId);
|
| | | if (config == null) return;
|
| | |
|
| | | itemIcon.gameObject.SetActive(true);
|
| | | bgIcon.gameObject.SetActive(true);
|
| | | itemIcon.SetSprite(itemConfig.IconKey);
|
| | | itemIcon.SetSprite(config.IconKey);
|
| | | bgIcon.SetItemBackGround(ItemLogicUtility.Instance.GetItemQuality(itemId, useDataDic));
|
| | |
|
| | | auctionIcon.gameObject.SetActive(isAuction);
|
| | |
| | | countText.text = UIHelper.ReplaceLargeNum((double)count);
|
| | | }
|
| | |
|
| | | int compareReslut = Compare(type, itemId, score, isCompare, compareScore, guid);
|
| | | var compareReslut = isCompare ? Compare(type, itemId, score, guid) : 0;
|
| | | switch (compareReslut)
|
| | | {
|
| | | case -1:
|
| | | stateIcon.gameObject.SetActive(true);
|
| | | stateIcon.SetSprite("EquipDownIcon");
|
| | | break;
|
| | | case 0:
|
| | | stateIcon.gameObject.SetActive(false);
|
| | | break;
|
| | | case 1:
|
| | | stateIcon.gameObject.SetActive(true);
|
| | | stateIcon.SetSprite("EquipForbidIcon");
|
| | | break;
|
| | | case 2:
|
| | | stateIcon.gameObject.SetActive(true);
|
| | | stateIcon.SetSprite("EquipUpIcon");
|
| | | break;
|
| | | case 3:
|
| | | case 99:
|
| | | stateIcon.gameObject.SetActive(true);
|
| | | stateIcon.SetSprite("EquipDownIcon");
|
| | | stateIcon.SetSprite("EquipForbidIcon");
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 0 不比较 1 禁止比较 2 高评分 3 低评分
|
| | | /// 0 相等 99 禁止比较 1 高评分 -1 低评分
|
| | | /// </summary>
|
| | | /// <param name="itemId"></param>
|
| | | /// <param name="score"></param>
|
| | | /// <param name="isCompare"></param>
|
| | | /// <param name="compareSocre"></param>
|
| | | /// <returns></returns>
|
| | | int Compare(PackType type, int itemId, int score, bool isCompare, int compareSocre, string guid)
|
| | | int Compare(PackType type, int itemId, int score, string guid)
|
| | | {
|
| | | if (!isCompare && compareSocre == 0)
|
| | | if (type == PackType.Equip || type == PackType.DogzEquip)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | |
|
| | | if (score == compareSocre && compareSocre != 0)
|
| | | if (!ItemLogicUtility.Instance.IsJobCompatibleItem(itemId))
|
| | | {
|
| | | return 0;
|
| | | }
|
| | |
|
| | | if (compareSocre <= 0 && (type == PackType.Equip || type == PackType.DogzEquip))
|
| | | {
|
| | | return 0;
|
| | | return 99;
|
| | | }
|
| | |
|
| | | var config = ItemConfig.Get(itemId);
|
| | |
| | | }
|
| | |
|
| | | var item = packModel.GetItemByGuid(guid);
|
| | | if (item != null && item.isAuction)
|
| | | {
|
| | | return 99;
|
| | | }
|
| | |
|
| | | if (item != null && ItemLogicUtility.Instance.IsOverdue(guid, itemId, item.useDataDict))
|
| | | {
|
| | | return 1;
|
| | | return 99;
|
| | | }
|
| | |
|
| | | if (!ItemLogicUtility.Instance.IsJobCompatibleItem(itemId))
|
| | | {
|
| | | return 1;
|
| | | }
|
| | |
|
| | | if (isCompare)
|
| | | {
|
| | | switch (type)
|
| | | {
|
| | | case PackType.DogzItem:
|
| | | compareSocre = GetCurrentEquipSocre(PackType.DogzEquip, config.EquipPlace);
|
| | | break;
|
| | | default:
|
| | | var result = equipModel.CompareToCurrent(guid);
|
| | | if (result == 0)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | else if (result > 0)
|
| | | {
|
| | | return 2;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 3;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (score == compareSocre)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | else
|
| | | {
|
| | | return score > compareSocre ? 2 : 3;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | int GetCurrentEquipSocre(PackType type, int equipPlace)
|
| | | {
|
| | | switch (type)
|
| | | {
|
| | | case PackType.DogzEquip:
|
| | | var dogzModel = ModelCenter.Instance.GetModel<DogzModel>();
|
| | | ItemModel putOnModel = null;
|
| | | dogzModel.TryGetDogzEquip(dogzModel.presentSelectDogz, equipPlace, out putOnModel);
|
| | | return putOnModel == null ? 0 : putOnModel.equipScore;
|
| | | case PackType.DogzItem:
|
| | | var compareSocre = GetDogzEquipSocre(config.EquipPlace);
|
| | | return score.CompareTo(compareSocre);
|
| | | default:
|
| | | ItemModel model = packModel.GetItemByIndex(type, equipPlace);
|
| | | return model == null ? 0 : model.equipScore;
|
| | | return equipModel.CompareToCurrent(guid);
|
| | | }
|
| | | }
|
| | |
|
| | | int GetDogzEquipSocre(int equipPlace)
|
| | | {
|
| | | var dogzModel = ModelCenter.Instance.GetModel<DogzModel>();
|
| | | ItemModel putOnModel = null;
|
| | | dogzModel.TryGetDogzEquip(dogzModel.presentSelectDogz, equipPlace, out putOnModel);
|
| | | return putOnModel == null ? 0 : putOnModel.equipScore;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public class ItemCellModel
|
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | using Snxxz.UI; |
| | | using System.Collections.Generic; |
| | | using System; |
| | |
| | | } |
| | | } |
| | | |
| | | public override void Init(ItemModel model, bool isCompare = false, int compareScore = 0) |
| | | public override void Init(ItemModel model, bool isCompare = false) |
| | | { |
| | | base.Init(model, isCompare, compareScore); |
| | | base.Init(model, isCompare); |
| | | reducebtn.gameObject.SetActive(false); |
| | | } |
| | | |
| | | public override void Init(ItemCellModel model, int compareScore = 0) |
| | | public override void Init(ItemCellModel model) |
| | | { |
| | | base.Init(model, compareScore); |
| | | base.Init(model); |
| | | reducebtn.gameObject.SetActive(false); |
| | | } |
| | | } |
| | |
| | | {
|
| | | [SerializeField] UIEffect m_RareSfx;
|
| | |
|
| | | public override void Init(ItemCellModel model, int compareScore = 0)
|
| | | public override void Init(ItemCellModel model)
|
| | | {
|
| | | if (m_RareSfx != null)
|
| | | {
|
| | |
| | | base.Init(model);
|
| | | }
|
| | |
|
| | | public void SetItemRare(ItemCellModel model, int _itemColor = 0, int compareScore = 0)
|
| | | public void SetItemRare(ItemCellModel model, int _itemColor = 0)
|
| | | {
|
| | | if (model == null)
|
| | | {
|