| | |
| | | |
| | | public Action<HeroInfo> onHeroChangeEvent; |
| | | |
| | | public Action<HeroInfo> onHeroDeleteEvent; |
| | | public Action<int> onHeroDeleteEvent; |
| | | |
| | | public override void Init() |
| | | { |
| | |
| | | |
| | | heroInfoDict.Remove(guid); |
| | | |
| | | if (null != heroInfo) |
| | | onHeroDeleteEvent?.Invoke(heroInfo); |
| | | onHeroDeleteEvent?.Invoke(itemID); |
| | | } |
| | | } |
| | | |
| | |
| | | //giftID 0 :代表灰色需升星激活 -1:代表棕色需觉醒激活,其他根据配表,没有天赋的外层控制显隐 |
| | | public void Init(int giftID, int lv, UnityAction onclick = null, int showState = 0, int heroID = 0, int index = 0) |
| | | { |
| | | LoadPrefab(); //存在被卸载的可能,重新加载 |
| | | if (HeroTalentConfig.HasKey(giftID)) |
| | | { |
| | | var config = HeroTalentConfig.Get(giftID); |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 武将吞噬成功界面 |
| | | /// </summary> |
| | | public class HeroGiftEatSuccessWin : UIBase |
| | | { |
| | | |
| | | [SerializeField] Image[] beforeStars; |
| | | [SerializeField] Image[] afterStars; |
| | | [SerializeField] Text[] attrPerNameArr; |
| | | [SerializeField] Text[] attrPerTextArr; |
| | | [SerializeField] Text[] nextAttrPerTextArr; |
| | | [SerializeField] GiftBaseCell[] giftBaseCellArr; |
| | | [SerializeField] Button okBtn; |
| | | |
| | | //角色 |
| | | [SerializeField] Image taiziBG; |
| | | [SerializeField] UIHeroController heroModel; |
| | | [SerializeField] Text nameText; |
| | | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | okBtn.AddListener(CloseWindow); |
| | | } |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | if (string.IsNullOrEmpty(HeroUIManager.Instance.selectHeroGuidForGiftFuncForSuccessWin)) |
| | | return; |
| | | Display(); |
| | | HeroUIManager.Instance.selectEatHeroGuid = ""; |
| | | } |
| | | |
| | | |
| | | public void Display() |
| | | { |
| | | HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFuncForSuccessWin); |
| | | if (hero == null) |
| | | return; |
| | | |
| | | int beforeStarCount = hero.heroStar - 1; |
| | | int afterStarCount = hero.heroStar; |
| | | |
| | | HeroUIManager.Instance.ShowStarImg(beforeStarCount, beforeStars); |
| | | HeroUIManager.Instance.ShowStarImg(afterStarCount, afterStars); |
| | | |
| | | |
| | | //上阵属性 |
| | | int valuePer = hero.GetOnBattleAddPer(); |
| | | for (int i = 0; i < attrPerTextArr.Length; i++) |
| | | { |
| | | int id = PlayerPropertyConfig.basePerAttrs[i]; |
| | | attrPerNameArr[i].text = PlayerPropertyConfig.Get(id).Name; |
| | | nextAttrPerTextArr[i].text = PlayerPropertyConfig.GetFullDescription(id, valuePer); |
| | | attrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(id, valuePer - hero.qualityConfig.StarAddPer); |
| | | } |
| | | |
| | | //天赋 |
| | | HeroUIManager.Instance.RefreshGiftCell(giftBaseCellArr, hero, HeroUIManager.Instance.heroBeforeGiftIDList, |
| | | HeroUIManager.Instance.heroBeforeGiftLevelList); |
| | | |
| | | var heroConfig = hero.heroConfig; |
| | | |
| | | taiziBG.SetSprite("herodz" + heroConfig.Quality); |
| | | heroModel.Create(hero.SkinID, heroConfig.UIScale); |
| | | nameText.text = hero.breakLevel == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, hero.breakLevel); |
| | | nameText.color = UIHelper.GetUIColorByFunc(heroConfig.Quality); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 11a2b53cd2efaff4d917ff992a43ca10 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | |
| | | [SerializeField] HeroShowBaseCell heroShow; |
| | | [SerializeField] GiftBaseCell[] giftCells; |
| | | [SerializeField] Button addHeroBtn; |
| | | [SerializeField] GameObject addHeroGo; |
| | | [SerializeField] Button addHeroGo; |
| | | [SerializeField] HeroShowBaseCell addHeroShow; |
| | | [SerializeField] GiftBaseCell[] addGiftCells; |
| | | [SerializeField] GameObject addTip; |
| | |
| | | [SerializeField] Text[] addAttrTexts; |
| | | [SerializeField] Text addGiftTip; |
| | | |
| | | [SerializeField] GameObject eatBtn; |
| | | [SerializeField] Button eatBtn; |
| | | |
| | | |
| | | |
| | | string addHeroGuid; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | addHeroBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroGiftRoleListWin>(); |
| | | }); |
| | | |
| | | addHeroGo.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroGiftRoleListWin>(); |
| | | }); |
| | | |
| | | eatBtn.AddListener(EatHero); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFunc); |
| | | Display(hero); |
| | | HeroUIManager.Instance.SelectEatHeroEvent += Display; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | addHeroGuid = ""; |
| | | HeroUIManager.Instance.selectEatHeroGuid = ""; |
| | | HeroUIManager.Instance.SelectEatHeroEvent -= Display; |
| | | } |
| | | |
| | | |
| | | public void Display(HeroInfo hero) |
| | | public void Display() |
| | | { |
| | | var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFunc); |
| | | |
| | | heroShow.Init(hero.heroId, hero.SkinID, hero.breakLevel, hero.heroStar, hero.awakeLevel, hero.heroLevel); |
| | | HeroUIManager.Instance.RefreshGiftCell(giftCells, hero); |
| | | if (string.IsNullOrEmpty(addHeroGuid)) |
| | | if (string.IsNullOrEmpty(HeroUIManager.Instance.selectEatHeroGuid)) |
| | | { |
| | | addHeroBtn.SetActive(true); |
| | | addHeroGo.SetActive(false); |
| | |
| | | addHeroGo.SetActive(true); |
| | | addTip.SetActive(false); |
| | | addAttrGo.SetActive(true); |
| | | var addHero = HeroManager.Instance.GetHero(addHeroGuid); |
| | | var addHero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectEatHeroGuid); |
| | | addHeroShow.Init(addHero.heroId, addHero.SkinID, addHero.breakLevel, addHero.heroStar, addHero.awakeLevel, addHero.heroLevel); |
| | | HeroUIManager.Instance.RefreshGiftCell(addGiftCells, addHero); |
| | | for (int i = 0; i < addAttrTexts.Length; i++) |
| | | { |
| | | int id = PlayerPropertyConfig.baseAttrs[i]; |
| | | addAttrTexts[i].text = PlayerPropertyConfig.GetFullDescription(id, hero.qualityConfig.StarAddPer); |
| | | int id = PlayerPropertyConfig.basePerAttrs[i]; |
| | | addAttrTexts[i].text = PlayerPropertyConfig.GetFullDescription(id, hero.qualityConfig.StarAddPer, |
| | | "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}", true)); |
| | | } |
| | | addGiftTip.SetActive(hero.IsFullGift()); |
| | | addGiftTip.SetActive(!hero.IsFullGift()); |
| | | } |
| | | } |
| | | |
| | | void EatHero() |
| | | { |
| | | if (HeroUIManager.Instance.selectEatHeroGuid == "") |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroGift3"); |
| | | return; |
| | | } |
| | | var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFunc); |
| | | var eatHero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectEatHeroGuid); |
| | | if (hero == null || eatHero == null) |
| | | return; |
| | | |
| | | var pack = new CB231_tagCSHeroStarUP(); |
| | | pack.ItemIndex = (ushort)hero.itemHero.gridIndex; |
| | | pack.UseItemIndex = (ushort)eatHero.itemHero.gridIndex; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | HeroUIManager.Instance.eatHeroIDForResult = hero.heroId; |
| | | HeroUIManager.Instance.selectHeroGuidForGiftFuncForSuccessWin = HeroUIManager.Instance.selectHeroGuidForGiftFunc; |
| | | HeroUIManager.Instance.heroBeforeGiftIDList = new List<int>(hero.talentIDList); |
| | | HeroUIManager.Instance.heroBeforeGiftLevelList = new List<int>(hero.talentLvList); |
| | | |
| | | //设置个等待回复的标识 显示成功界面 |
| | | HeroUIManager.Instance.waitResponse = new WaitHeroFuncResponse() |
| | | { |
| | | guid = HeroUIManager.Instance.selectHeroGuidForGiftFuncForSuccessWin, |
| | | type = HeroFuncType.Gift, |
| | | time = Time.time |
| | | }; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class HeroGiftRoleListCell : CellView |
| | | { |
| | | [SerializeField] Button addHeroBtn; |
| | | [SerializeField] HeroShowBaseCell addHeroShow; |
| | | [SerializeField] GiftBaseCell[] addGiftCells; |
| | | [SerializeField] Image onTeamImg; |
| | | |
| | | public void Display(int index) |
| | | { |
| | | addHeroBtn.AddListener(()=> { AddHero(index); }); |
| | | |
| | | var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.heroEatList[index]); |
| | | addHeroShow.Init(hero.heroId, hero.SkinID, hero.breakLevel, hero.heroStar, hero.awakeLevel, hero.heroLevel, hero.isLock); |
| | | HeroUIManager.Instance.RefreshGiftCell(addGiftCells, hero); |
| | | |
| | | onTeamImg.SetActive(hero.IsInAnyTeam()); |
| | | } |
| | | |
| | | void AddHero(int index) |
| | | { |
| | | var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.heroEatList[index]); |
| | | //上阵 锁定 觉醒 的情况 |
| | | if (hero.awakeLevel > 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroReborn1"); |
| | | return; |
| | | } |
| | | |
| | | if (hero.IsInAnyTeamJustOne()) |
| | | { |
| | | //阵容至少要有一个武将上阵 |
| | | SysNotifyMgr.Instance.ShowTip("HeroFunc3"); |
| | | return; |
| | | } |
| | | |
| | | if (hero.isLock) |
| | | { |
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), |
| | | Language.Get("herocard66"), (bool isOK) => |
| | | { |
| | | if (isOK) |
| | | { |
| | | hero.ChangeLockState(); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | if (hero.IsInAnyTeam()) |
| | | { |
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), |
| | | Language.Get("herocard65"), (bool isOK) => |
| | | { |
| | | if (isOK) |
| | | { |
| | | hero.LeaveAllTeam(); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | if (hero.heroStar > 0) |
| | | { |
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), |
| | | Language.Get("HeroGift13"), (bool isOK) => |
| | | { |
| | | if (isOK) |
| | | { |
| | | HeroUIManager.Instance.selectEatHeroGuid = HeroUIManager.Instance.heroEatList[index]; |
| | | UIManager.Instance.CloseWindow<HeroGiftRoleListWin>(); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | |
| | | HeroUIManager.Instance.selectEatHeroGuid = HeroUIManager.Instance.heroEatList[index]; |
| | | UIManager.Instance.CloseWindow<HeroGiftRoleListWin>(); |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: cce54ec2509e8434d997bdc18df0a86d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 武将吞噬列表界面 |
| | | /// </summary> |
| | | public class HeroGiftRoleListWin : UIBase |
| | | { |
| | | [SerializeField] ScrollerController scroller; |
| | | [SerializeField] GameObject emptyGo; |
| | | |
| | | |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | HeroUIManager.Instance.CacheHeroEatList(); |
| | | scroller.OnRefreshCell += Scroller_OnRefreshCell; |
| | | TeamManager.Instance.OnTeamChange += OnTeamChange; |
| | | PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= Scroller_OnRefreshCell; |
| | | TeamManager.Instance.OnTeamChange -= OnTeamChange; |
| | | PackManager.Instance.RefreshItemLockEvent -= RefreshItemLockEvent; |
| | | HeroUIManager.Instance.heroEatList.Clear(); |
| | | } |
| | | |
| | | |
| | | public void Display() |
| | | { |
| | | |
| | | if (HeroUIManager.Instance.heroEatList.Count <= 0) |
| | | { |
| | | emptyGo.SetActive(true); |
| | | scroller.SetActive(false); |
| | | return; |
| | | } |
| | | |
| | | emptyGo.SetActive(false); |
| | | scroller.SetActive(true); |
| | | |
| | | scroller.Refresh(); |
| | | for (int i = 0; i < HeroUIManager.Instance.heroEatList.Count; i++) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | scroller.Restart(); |
| | | } |
| | | |
| | | void Scroller_OnRefreshCell(ScrollerDataType type, CellView cellView) |
| | | { |
| | | HeroGiftRoleListCell heroGiftRoleListCell = cellView as HeroGiftRoleListCell; |
| | | heroGiftRoleListCell.Display(cellView.index); |
| | | } |
| | | void OnTeamChange(TeamType type) |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | void RefreshItemLockEvent(PackType type, string guid, bool lockState) |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: dba53fa735a5856468c405d877c0f20f |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | // 武将小头像,(职业和名称不再此管理,各个界面排版不同) |
| | | public void Init(int heroID, int skinID, int star = 0, int awakelv = 0, int lv = 0, UnityAction onclick = null) |
| | | { |
| | | LoadPrefab(); //存在被卸载的可能,重新加载 |
| | | clickBtn.AddListener(onclick); |
| | | var heroConfig = HeroConfig.Get(heroID); |
| | | qualityBG.SetSprite("heroheadBG" + heroConfig.Quality); |
| | |
| | | PackManager.Instance.gridRefreshEvent += GridRefreshEvent; |
| | | PackManager.Instance.RefreshItemEvent += RefreshItemEvent; |
| | | UIManager.Instance.OnCloseWindow += OnCloseWindow; |
| | | HeroManager.Instance.onHeroDeleteEvent += HeroDeleteEvent; |
| | | HeroUIManager.Instance.SortHeroList(); |
| | | CreateScroller(); |
| | | Refresh(); |
| | |
| | | PackManager.Instance.RefreshItemEvent -= RefreshItemEvent; |
| | | PackManager.Instance.gridRefreshEvent -= GridRefreshEvent; |
| | | UIManager.Instance.OnCloseWindow -= OnCloseWindow; |
| | | HeroManager.Instance.onHeroDeleteEvent -= HeroDeleteEvent; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | void HeroDeleteEvent(int heroID) |
| | | { |
| | | HeroUIManager.Instance.SortHeroList(); |
| | | heroListScroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | void RefreshEmptyTip() |
| | | { |
| | | if (HeroUIManager.Instance.heroSortList.Count <= 0) |
| | |
| | | // 武将模型站台显示 |
| | | public void Init(int heroID, int skinID, int breakLevel = 0, int star = 0, int awakelv = 0, int lv = 0, bool isShowLock = false) |
| | | { |
| | | LoadPrefab(); //存在被卸载的可能,重新加载 |
| | | var heroConfig = HeroConfig.Get(heroID); |
| | | qualityBG.SetSprite("herodz" + heroConfig.Quality); |
| | | // int skinID = 0; |
| | |
| | | [SerializeField] Button awakeBtn; |
| | | |
| | | [SerializeField] Button closeBtn; //关闭按钮 |
| | | |
| | | [SerializeField] Button starBtn; //显示星级文字 |
| | | [SerializeField] List<Image> starImgList; |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] UIEffectPlayer nameEffect; |
| | |
| | | |
| | | starUPBtn.AddListener(StarUP); |
| | | washBtn.AddListener(Wash); |
| | | |
| | | starBtn.AddListener(() => |
| | | { |
| | | SmallTipWin.showText = Language.Get("HeroGift14",hero.heroStar); |
| | | SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality)) |
| | | { |
| | | starUPBtn.interactable = false; |
| | | starUPBtn.SetColorful(null, false); |
| | | starUPBtn.SetInteractable(false); |
| | | starUPBtnText.text = Language.Get("HeroGift7"); |
| | | } |
| | | else if (hero.IsFullStar()) |
| | | { |
| | | starUPBtn.interactable = true; |
| | | starUPBtn.SetColorful(null, false); |
| | | starUPBtn.SetInteractable(true); |
| | | starUPBtn.SetColorful(starUPBtn.GetComponentInChildren<Text>(), true); |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | } |
| | | else |
| | | { |
| | | starUPBtn.interactable = true; |
| | | starUPBtn.SetColorful(null, true); |
| | | starUPBtn.SetInteractable(true); |
| | | starUPBtn.SetColorful(starUPBtn.GetComponentInChildren<Text>(), true); |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | } |
| | | |
| | | if (hero.heroStar < HeroUIManager.Instance.canWashStarLevel) |
| | | { |
| | | washBtn.SetColorful(washBtn.GetComponentInChildren<Text>(), false); |
| | | } |
| | | else |
| | | { |
| | | washBtn.SetColorful(washBtn.GetComponentInChildren<Text>(), true); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | using LitJson; |
| | | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | //天赋 |
| | | public partial class HeroUIManager : GameSystemManager<HeroUIManager> |
| | |
| | | public int[] washByLockUseCounts; |
| | | public int canWashStarLevel; //达到X星可以洗练 |
| | | |
| | | public string selectHeroGuidForGiftFunc; |
| | | public string selectHeroGuidForGiftFunc;//武将主体GUID |
| | | |
| | | public int eatHeroIDForResult; //等待吞噬结果武将ID 为了弹成功界面使用 |
| | | public string selectHeroGuidForGiftFuncForSuccessWin; //等待服务器返回的武将GUID 显示成功界面内容 |
| | | public List<int> heroBeforeGiftIDList = new List<int>(); //会有重复的ID,不要用字典 |
| | | public List<int> heroBeforeGiftLevelList = new List<int>(); |
| | | |
| | | |
| | | public event Action SelectEatHeroEvent; |
| | | string m_SelectEatHeroGuid; //被吞噬武将GUID |
| | | public string selectEatHeroGuid |
| | | { |
| | | get { return m_SelectEatHeroGuid; } |
| | | set |
| | | { |
| | | m_SelectEatHeroGuid = value; |
| | | SelectEatHeroEvent?.Invoke(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public List<string> heroEatList = new List<string>(); |
| | | |
| | | |
| | | void ParseGiftConfig() |
| | | { |
| | |
| | | } |
| | | return HeroQualityConfig.Get(quality).InitStarUpper + addStarCount; |
| | | } |
| | | |
| | | |
| | | public void RefreshGiftCell(GiftBaseCell[] giftBaseCells, HeroInfo hero) |
| | | |
| | | |
| | | //beforeGiftIDList用于对比变化的天赋格子 |
| | | public void RefreshGiftCell(GiftBaseCell[] giftBaseCells, HeroInfo hero, List<int> beforeGiftIDList= null, List<int> beforeGiftLevelList= null) |
| | | { |
| | | int showCount = GetGiftGirdMaxCount(hero.heroId); |
| | | for (int i = 0; i < giftBaseCells.Length; i++) |
| | |
| | | { |
| | | int giftID = hero.talentIDList[i]; |
| | | int giftLV = hero.talentLvList[i]; |
| | | giftBaseCells[i].Init(giftID, giftLV); |
| | | int state = 0; //0:不显示 1:新增 2:提升 |
| | | |
| | | if (!beforeGiftIDList.IsNullOrEmpty()) |
| | | { |
| | | if (i >= beforeGiftIDList.Count) |
| | | { |
| | | state = 1; |
| | | } |
| | | else |
| | | { |
| | | if (giftID != beforeGiftIDList[i]) |
| | | { |
| | | state = 1; |
| | | } |
| | | else |
| | | { |
| | | if (giftLV > beforeGiftLevelList[i]) |
| | | { |
| | | state = 2; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | giftBaseCells[i].Init(giftID, giftLV, null, state); |
| | | } |
| | | else |
| | | { |
| | | if (!beforeGiftIDList.IsNullOrEmpty()) |
| | | { |
| | | //对比情况下不显示 |
| | | giftBaseCells[i].SetActive(false); |
| | | continue; |
| | | } |
| | | |
| | | //非对比的显示 |
| | | if (i < normalGiftMaxCnt) |
| | | { |
| | | giftBaseCells[i].Init(0, 0); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public void CacheHeroEatList() |
| | | { |
| | | heroEatList = PackManager.Instance.GetSinglePack(PackType.Hero).GetItemGUIDListById( |
| | | HeroManager.Instance.GetHero(selectHeroGuidForGiftFunc).heroId); |
| | | heroEatList.Remove(selectHeroGuidForGiftFunc); //排除吞噬主体 |
| | | heroEatList.Sort(CmpDeleteHero); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public void ShowStarImg(int starCount, Image[] starImages, bool noStarShow = true) |
| | | { |
| | | int imgCount = starImages.Length; |
| | | for (int i = 0; i < imgCount; i++) |
| | | { |
| | | if (starCount == 0 && i == 0) |
| | | { |
| | | if (noStarShow) |
| | | { |
| | | // 无星级 特殊处理 显示一个空星星 |
| | | starImages[i].SetActive(true); |
| | | starImages[i].SetSprite("herostar" + starCount); |
| | | } |
| | | else |
| | | { |
| | | starImages[i].SetActive(false); |
| | | } |
| | | } |
| | | else if ((starCount - 1) % imgCount >= i) |
| | | { |
| | | starImages[i].SetActive(true); |
| | | starImages[i].SetSprite("herostar" + (((starCount - 1) / imgCount) + 1) * imgCount); |
| | | } |
| | | else |
| | | { |
| | | starImages[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroLVBreakSuccessWin>(); |
| | | } |
| | | |
| | | else if (waitResponse.type == HeroFuncType.Gift) |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroGiftEatSuccessWin>(); |
| | | } |
| | | waitResponse = default; |
| | | |
| | | } |
| | |
| | | { |
| | | None = 0, //无功能 |
| | | Break = 1, //突破 |
| | | Gift = 2, //天赋吞噬 |
| | | |
| | | } |
| | |
| | | return list; |
| | | } |
| | | |
| | | public List<string> GetItemGUIDListById(int itemId) |
| | | { |
| | | var list = new List<string>(); |
| | | if (itemIDs.ContainsKey(itemId)) |
| | | { |
| | | foreach (var index in itemIDs[itemId]) |
| | | { |
| | | var item = items[index]; |
| | | list.Add(item.guid); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | |
| | | public long GetCountById(int itemId, bool includeAuction = true) |
| | | { |
| | | long count = 0; |
| | |
| | | var config = ItemConfig.Get(itemId);
|
| | | if (config == null) return;
|
| | |
|
| | | LoadPrefab(); //存在被卸载的可能,重新加载
|
| | | itemIcon.SetActive(true);
|
| | | bgIcon.SetActive(true);
|
| | | itemIcon.SetOrgSprite(config.IconKey);
|
| | |
| | | |
| | | public void InitUI(int offcialRank, int titleID) |
| | | { |
| | | LoadPrefab(); //存在被卸载的可能,重新加载 |
| | | if (titleID == 0) |
| | | { |
| | | officialRankObj.SetActive(true); |
| | |
| | | {
|
| | | if (model == null)
|
| | | return;
|
| | | LoadPrefab(); //存在被卸载的可能,重新加载
|
| | | string img = AvatarHelper.GetAvatarBgColorStr(model.avatarID);
|
| | | bgImage.SetSprite(img);
|
| | | InitUI(model.avatarID, model.avatarUIEffectID, model.avatarFrameID, model.avatarFrameUIEffectID);
|
| | |
| | | |
| | | public void Init(int skillID, UnityAction onclick = null, bool showType = false) |
| | | { |
| | | LoadPrefab(); //存在被卸载的可能,重新加载 |
| | | var config = SkillConfig.Get(skillID); |
| | | if (config == null) |
| | | { |
| | |
| | | |
| | | public void Init(int skillID, UnityAction onclick = null, bool showType = false) |
| | | { |
| | | LoadPrefab(); //存在被卸载的可能,重新加载 |
| | | var config = SkillConfig.Get(skillID); |
| | | if (config == null) |
| | | { |