218 子 【付费内容】首充 / 【付费内容】首充-客户端 实现获得英雄物品,大于等于传奇品质展示英雄立绘,逻辑同抽奖
1个文件已修改
2个文件已添加
123 ■■■■■ 已修改文件
Main/System/FirstCharge/HeroShowLHWin.cs 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/FirstCharge/HeroShowLHWin.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/KnapSack/Logic/ItemLogicUtility.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/FirstCharge/HeroShowLHWin.cs
New file
@@ -0,0 +1,71 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class HeroShowLHWin : UIBase
{
    [SerializeField] UIHeroController roleLHModel;
    [SerializeField] PositionTween roleLHModelTween;
    [SerializeField] UIAlphaTween roleLHModelTween2;
    [SerializeField] RawImage bgTexture;
    [SerializeField] Image qualityImg;
    [SerializeField] HeroCallResultCell showLHResultCell;
    [SerializeField] Image newMarkLHImg;
    [SerializeField] Button showNextlhOrCloseBtn;
    [SerializeField] Text heroNameText;
    [SerializeField] Image heroCountryImg;
    [SerializeField] Image heroJobImg;
    [SerializeField] Text jobPosNameText;
    protected override void InitComponent()
    {
        showNextlhOrCloseBtn.AddListener(RefreshLihui);
    }
    protected override void OnPreOpen()
    {
        RefreshLihui();
    }
    protected override void OnPreClose()
    {
    }
    void RefreshLihui()
    {
        //汇总品质传说及以上的立绘
        int heroID = 0;
        if (ItemLogicUtility.Instance.poplhHeroIdList.Count > 0)
        {
            heroID = ItemLogicUtility.Instance.poplhHeroIdList[0];
            ItemLogicUtility.Instance.poplhHeroIdList.RemoveAt(0);
        }
        else
        {
            CloseWindow();
            return;
        }
        var hero = HeroConfig.Get(heroID);
        roleLHModel.Create(hero.SkinIDList[0], 1, motionName: "", isLh: true);
        qualityImg.SetSprite("HeroCallQuality" + hero.Quality);
        newMarkLHImg.SetActive(HeroUIManager.Instance.IsNewHero(heroID));
        showLHResultCell.Display(heroID, 0, true);
        RefreshHeroInfo(heroID);
        roleLHModelTween.SetStartState();
        roleLHModelTween.Play();
        roleLHModelTween2.SetStartState();
        roleLHModelTween2.Play();
        bgTexture.SetTexture2D("countryBG" + hero.Country);
    }
    void RefreshHeroInfo(int heroID)
    {
        var heroConfig = HeroConfig.Get(heroID);
        heroNameText.text = heroConfig.Name;
        heroNameText.color = UIHelper.GetUIColorByFunc(heroConfig.Quality);
        heroCountryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
        heroJobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class));
        jobPosNameText.text = HeroUIManager.Instance.GetJobName(heroConfig.Class) + "  " + heroConfig.Desc;
    }
}
Main/System/FirstCharge/HeroShowLHWin.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 72585065cb2d25e45bd99b5e43fc7261
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/KnapSack/Logic/ItemLogicUtility.cs
@@ -173,7 +173,7 @@
    }
    // private Dictionary<int, int> GetEquipLegendProperties(int itemId)
    // {
@@ -256,7 +256,7 @@
            }
        }
    }
    #endregion
@@ -296,7 +296,7 @@
        return isEnough;
    }
    public event Action<string> GetBetterEquipEvent; //得到更好的装备 value 物品的实例ID
@@ -819,7 +819,7 @@
    // }
    #endregion
    bool IsCanPutOn(ItemModel item)
    {
@@ -1143,8 +1143,37 @@
    //     return itemModel.config.SuiteiD == 0 && itemConfig.SuiteiD != 0;
    // }
    #region 获得英雄物品展示立绘
    public List<int> poplhHeroIdList = new List<int>();
    public void SetHeroList(List<Item> items)
    {
        if (items.IsNullOrEmpty())
            return;
        foreach (var item in items)
        {
            int itemId = item.id;
            if (HeroConfig.HasKey(itemId) &&
                HeroConfig.Get(itemId).Quality >= HappyXBModel.Instance.lhQuality)
            {
                poplhHeroIdList.Add(itemId);
            }
        }
    }
    public void ShowHeroLHWin(List<Item> items)
    {
        SetHeroList(items);
        if (poplhHeroIdList.Count > 0)
        {
            if (!UIManager.Instance.IsOpenedInList<HeroShowLHWin>())
            {
                UIManager.Instance.OpenWindow<HeroShowLHWin>();
            }
        }
    }
    #endregion
    public Action OnGetItem;    //CommonGetItemWin界面关闭时触发
    public string getItemInfo { get; private set; }  //通用显示获得的界面信息
@@ -1193,6 +1222,8 @@
        {
            UIManager.Instance.OpenWindow<CommonGetItemWin>();
        }
        ShowHeroLHWin(items);//有传奇以上英雄显示立绘
    }
    //可以指定打开的窗口
@@ -1237,6 +1268,8 @@
        {
            UIManager.Instance.OpenWindow<T>();
        }
        ShowHeroLHWin(items);//有传奇以上英雄显示立绘
    }
    public void ClearGetItem()
    {