Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
| | |
| | |
|
| | | // 加载配置文件
|
| | | HashSet<Type> configTypes = new HashSet<Type>() {
|
| | | typeof(ChestsAwardConfig),
|
| | | typeof(CTGConfig),
|
| | | typeof(DamageNumConfig),
|
| | | typeof(DirtyWordConfig),
|
| | | typeof(FaceConfig),
|
| | | typeof(FightPowerRatioConfig),
|
| | | typeof(HeroLineupHaloConfig),
|
| | | typeof(HeroQualityLVConfig),
|
| | | typeof(InvestConfig),
|
| | | typeof(ItemConfig),
|
| | | typeof(MainChapterConfig),
|
| | | typeof(MainLevelConfig),
|
| | | typeof(PlayerLVConfig),
|
| | | typeof(TitleStarUpConfig)
|
| | | typeof(NPCConfig),
|
| | | typeof(NPCExConfig),
|
| | | typeof(NPCLineupConfig),
|
| | | typeof(OrderInfoConfig),
|
| | | typeof(PlayerAttrConfig),
|
| | | typeof(PlayerFaceConfig),
|
| | | typeof(StoreConfig),
|
| | | typeof(SuccessConfig),
|
| | | typeof(SysInfoConfig),
|
| | | typeof(TitleStarUpConfig),
|
| | | typeof(TreasureSetConfig),
|
| | | typeof(TreeLVConfig),
|
| | | typeof(WindowSearchConfig),
|
| | | typeof(XBGetItemConfig)
|
| | | };
|
| | |
|
| | | #if UNITY_EDITOR
|
| | |
| | |
|
| | | public override void Release()
|
| | | {
|
| | | // 清空 ChestsAwardConfig 字典
|
| | | ClearConfigDictionary<ChestsAwardConfig>();
|
| | | // 清空 CTGConfig 字典
|
| | | ClearConfigDictionary<CTGConfig>();
|
| | | // 清空 DamageNumConfig 字典
|
| | | ClearConfigDictionary<DamageNumConfig>();
|
| | | // 清空 DirtyWordConfig 字典
|
| | | ClearConfigDictionary<DirtyWordConfig>();
|
| | | // 清空 FaceConfig 字典
|
| | | ClearConfigDictionary<FaceConfig>();
|
| | | // 清空 FightPowerRatioConfig 字典
|
| | | ClearConfigDictionary<FightPowerRatioConfig>();
|
| | | // 清空 HeroLineupHaloConfig 字典
|
| | |
| | | ClearConfigDictionary<InvestConfig>();
|
| | | // 清空 ItemConfig 字典
|
| | | ClearConfigDictionary<ItemConfig>();
|
| | | // 清空 MainChapterConfig 字典
|
| | | ClearConfigDictionary<MainChapterConfig>();
|
| | | // 清空 MainLevelConfig 字典
|
| | | ClearConfigDictionary<MainLevelConfig>();
|
| | | // 清空 PlayerLVConfig 字典
|
| | | ClearConfigDictionary<PlayerLVConfig>();
|
| | | // 清空 NPCConfig 字典
|
| | | ClearConfigDictionary<NPCConfig>();
|
| | | // 清空 NPCExConfig 字典
|
| | | ClearConfigDictionary<NPCExConfig>();
|
| | | // 清空 NPCLineupConfig 字典
|
| | | ClearConfigDictionary<NPCLineupConfig>();
|
| | | // 清空 OrderInfoConfig 字典
|
| | | ClearConfigDictionary<OrderInfoConfig>();
|
| | | // 清空 PlayerAttrConfig 字典
|
| | | ClearConfigDictionary<PlayerAttrConfig>();
|
| | | // 清空 PlayerFaceConfig 字典
|
| | | ClearConfigDictionary<PlayerFaceConfig>();
|
| | | // 清空 StoreConfig 字典
|
| | | ClearConfigDictionary<StoreConfig>();
|
| | | // 清空 SuccessConfig 字典
|
| | | ClearConfigDictionary<SuccessConfig>();
|
| | | // 清空 SysInfoConfig 字典
|
| | | ClearConfigDictionary<SysInfoConfig>();
|
| | | // 清空 TitleStarUpConfig 字典
|
| | | ClearConfigDictionary<TitleStarUpConfig>();
|
| | | // 清空 TreasureSetConfig 字典
|
| | | ClearConfigDictionary<TreasureSetConfig>();
|
| | | // 清空 TreeLVConfig 字典
|
| | | ClearConfigDictionary<TreeLVConfig>();
|
| | | // 清空 WindowSearchConfig 字典
|
| | | ClearConfigDictionary<WindowSearchConfig>();
|
| | | // 清空 XBGetItemConfig 字典
|
| | | ClearConfigDictionary<XBGetItemConfig>();
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年8月17日
|
| | | // [ Date ]: 2025年9月9日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int[] FetterIDList;
|
| | | public float UIScale;
|
| | | public string Desc;
|
| | | public int[] TalentList;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | |
| | | float.TryParse(tables[14],out UIScale);
|
| | |
|
| | | Desc = tables[15];
|
| | |
|
| | | if (tables[16].Contains("[")) |
| | | { |
| | | TalentList = JsonMapper.ToObject<int[]>(tables[16]); |
| | | } |
| | | else |
| | | { |
| | | string[] TalentListStringArray = tables[16].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | TalentList = new int[TalentListStringArray.Length]; |
| | | for (int i=0;i<TalentListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(TalentListStringArray[i],out TalentList[i]); |
| | | } |
| | | }
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | |
| | | return GetHeroAwakeConfig(heroID, awakeLv) != null; |
| | | } |
| | | |
| | | //解锁指定天赋槽位需要的觉醒等级 |
| | | public static int GetAwakeLVByUnLockGiftIndex(int heroID, int index) |
| | | { |
| | | Dictionary<int, HeroAwakeConfig> tempDic = null; |
| | |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | public static int GetMaxAwakeLV(int heroID) |
| | | { |
| | | Dictionary<int, HeroAwakeConfig> tempDic = null; |
| | |
| | | { |
| | | return GetHeroBreakConfig(heroID, breakLv) == null; |
| | | } |
| | | |
| | | public static int GetMaxBreakLv(int heroID) |
| | | { |
| | | Dictionary<int, HeroBreakConfig> tempDic = null; |
| | | if (!configDics.TryGetValue(heroID, out tempDic)) |
| | | { |
| | | return 0; |
| | | } |
| | | return tempDic.Count; |
| | | } |
| | | } |
| | |
| | | |
| | | public class CB237_tagCSHeroBookUP : GameNetPackBasic { |
| | | public uint HeroID; //武将ID |
| | | public ushort ItemIndex; //关联武将物品所在武将背包索引,激活时可不用发 |
| | | public byte BookType; //图鉴激活类型: 0-初始激活;1-星级升级;2-突破等级升级 |
| | | |
| | | public CB237_tagCSHeroBookUP () { |
| | |
| | | |
| | | public override void WriteToBytes () { |
| | | WriteBytes (HeroID, NetDataType.DWORD); |
| | | WriteBytes (ItemIndex, NetDataType.WORD); |
| | | WriteBytes (BookType, NetDataType.BYTE); |
| | | } |
| | | |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B1 22 武将图鉴信息 #tagSCHeroInfo
|
| | | // B1 22 武将信息 #tagSCHeroInfo
|
| | |
|
| | | public class DTCB122_tagSCHeroInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B1 22 武将图鉴信息 #tagSCHeroInfo
|
| | | // B1 22 武将信息 #tagSCHeroInfo
|
| | |
|
| | | public class HB122_tagSCHeroInfo : GameNetPackBasic {
|
| | | public ushort HeroCnt;
|
| | |
| | | TransBytes (out HeroInfoList[i].BookInitState, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out HeroInfoList[i].BookStarLV, vBytes, NetDataType.WORD);
|
| | | TransBytes (out HeroInfoList[i].BookBreakLV, vBytes, NetDataType.WORD);
|
| | | TransBytes (out HeroInfoList[i].BookStarLVH, vBytes, NetDataType.WORD);
|
| | | TransBytes (out HeroInfoList[i].BookBreakLVH, vBytes, NetDataType.WORD);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public byte BookInitState; // 图鉴激活状态:0-未激活;1-可激活;2-已激活
|
| | | public ushort BookStarLV; // 图鉴星级等级
|
| | | public ushort BookBreakLV; // 图鉴突破等级
|
| | | public ushort BookStarLVH; // 图鉴星级历史最高等级
|
| | | public ushort BookBreakLVH; // 图鉴突破历史最高等级
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | { |
| | | return null; |
| | | } |
| | | return ResManager.Instance.LoadAsset<Texture2D>(StringUtility.Contact(ResourcesPath.UI_SPRITE_SUFFIX, "/" + iconConfig.folder), iconConfig.sprite); |
| | | return ResManager.Instance.LoadAsset<Texture2D>(StringUtility.Contact(ResourcesPath.UI_TEXTURE_SUFFIX, "/" + iconConfig.folder), iconConfig.sprite); |
| | | } |
| | | } |
| | |
| | | //上阵属性:攻防血 |
| | | public int GetOnBattleAddPer() |
| | | { |
| | | return qualityConfig.InitAddPer + qualityConfig.LVAddPer * heroLevel + qualityConfig.BreakLVAddPer * breakLevel + qualityConfig.StarAddPer * heroStar; |
| | | return qualityConfig.InitAddPer + qualityConfig.LVAddPer * (heroLevel - 1) + qualityConfig.BreakLVAddPer * breakLevel + qualityConfig.StarAddPer * heroStar; |
| | | } |
| | | |
| | | public int GetLineupLVAddPer() |
| | | { |
| | | return qualityConfig.LVAddPer * heroLevel; |
| | | return qualityConfig.LVAddPer * (heroLevel - 1); |
| | | } |
| | | |
| | | public int GetLineupBreakLVAddPer() |
| | |
| | | { |
| | | get |
| | | { |
| | | // 因为觉醒降低了星级,客户端自己降低星级 |
| | | if (itemHero == null) |
| | | return 0; |
| | | |
| | | return Math.Min(GetCurMaxStar(), heroStarMaxBefore); |
| | | } |
| | | } |
| | | |
| | | // 因为觉醒降低了星级,保留历史最大星级 |
| | | public int heroStarMaxBefore |
| | | { |
| | | get |
| | | { |
| | | if (itemHero == null) |
| | | return 0; |
| | | return itemHero.GetUseDataFirstValue(72); |
| | | } |
| | | } |
| | | |
| | | |
| | | // 71 # 英雄天赋ID列表 |
| | | public List<int> talentIDList |
| | |
| | | } |
| | | } |
| | | |
| | | Image m_AwakeLockImg; //重生降低觉醒等级锁定的图片 |
| | | Image awakeLockImg |
| | | { |
| | | get |
| | | { |
| | | if (m_AwakeLockImg == null) |
| | | { |
| | | m_AwakeLockImg = this.transform.GetComponent<Image>("Container_GiftCell/lock"); |
| | | } |
| | | return m_AwakeLockImg; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | void Awake() |
| | |
| | | |
| | | //showState 0:不显示 1:新增 2:提升 |
| | | //giftID 0 :代表灰色需升星激活 -1:代表棕色需觉醒激活,其他根据配表,没有天赋的外层控制显隐 |
| | | public void Init(int giftID, int lv, UnityAction onclick = null, int showState = 0, int heroID = 0, int index = 0) |
| | | public void Init(int giftID, int lv, int showState = 0, int heroID = 0, int index = 0, int awakeLevel = 0) |
| | | { |
| | | LoadPrefab(); //存在被卸载的可能,重新加载 |
| | | if (HeroTalentConfig.HasKey(giftID)) |
| | |
| | | stateImg.SetActive(showState > 0); |
| | | stateImg.SetSprite("GiftState" + showState); |
| | | stateImg.SetNativeSize(); |
| | | |
| | | //特殊处理重生降低觉醒等级锁定的天赋 |
| | | if (index >= HeroUIManager.Instance.normalGiftMaxCnt) |
| | | { |
| | | awakeLockImg.SetActive(HeroAwakeConfig.GetAwakeLVByUnLockGiftIndex(heroID, index) > awakeLevel); |
| | | } |
| | | else |
| | | { |
| | | awakeLockImg.SetActive(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | giftName.text = string.Empty; |
| | | lvRect.SetActive(false); |
| | | stateImg.SetActive(false); |
| | | awakeLockImg.SetActive(false); |
| | | } |
| | | giftBtn.AddListener(onclick != null ? onclick : () => { ShowSmallTip(giftID, lv, heroID, index); }); |
| | | giftBtn.AddListener(() => { ShowSmallTip(giftID, lv, heroID, index, awakeLevel); }); |
| | | } |
| | | |
| | | void ShowSmallTip(int giftID, int giftLV, int heroID, int index) |
| | | void ShowSmallTip(int giftID, int giftLV, int heroID, int index, int awakeLevel) |
| | | { |
| | | SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); |
| | | if (giftID > 0) |
| | |
| | | var giftConfig = HeroTalentConfig.Get(giftID); |
| | | SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV), |
| | | Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue*giftLV))); |
| | | |
| | | if (index >= HeroUIManager.Instance.normalGiftMaxCnt) |
| | | { |
| | | int needAwakeLV = HeroAwakeConfig.GetAwakeLVByUnLockGiftIndex(heroID, index); |
| | | if (needAwakeLV > awakeLevel) |
| | | { |
| | | SmallTipWin.showText += "\n" + Language.Get("HeroAwake18", needAwakeLV); |
| | | } |
| | | } |
| | | |
| | | |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | |
| | | } |
| | |
| | | currentSubUI = UIManager.Instance.OpenWindow<HeroListWin>(); |
| | | break; |
| | | case 1: |
| | | //currentSubUI = UIManager.Instance.OpenWindow<HeroCollectionsWin>(); |
| | | currentSubUI = UIManager.Instance.OpenWindow<HeroCollectionWin>(); |
| | | break; |
| | | case 2: |
| | | break; |
| | |
| | | { |
| | | [SerializeField] Button heroCardBtn; |
| | | [SerializeField] Image heroCardBG; |
| | | [SerializeField] Material glowMaterial; // 流光效果材质 |
| | | [SerializeField] Text lvText; |
| | | [SerializeField] Image countryImg; |
| | | [SerializeField] Image jobImg; |
| | |
| | | |
| | | this.gameObject.SetActive(true); |
| | | heroCardBG.SetSprite("herocardbg" + hero.Quality); |
| | | if (glowMaterial != null) |
| | | { |
| | | heroCardBG.material = glowMaterial; |
| | | } |
| | | lvText.text = Language.Get("L1094") + hero.heroLevel.ToString(); |
| | | var heroConfig = hero.heroConfig; |
| | | countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country)); |
| | |
| | | { |
| | | [SerializeField] Button heroCardBtn; |
| | | [SerializeField] Image heroCardBG; |
| | | [SerializeField] Material glowMaterial; // 流光效果材质 |
| | | [SerializeField] Text lvText; |
| | | [SerializeField] UIHeroController heroModel; |
| | | [SerializeField] List<Image> starImgList; |
| | | [SerializeField] Image countryImg; |
| | | [SerializeField] Image jobImg; |
| | | [SerializeField] UIHeroController heroModel; |
| | | [SerializeField] Image onStateImg; |
| | | [SerializeField] RedpointBehaviour redpoint; |
| | | [SerializeField] Image trainStateImg; |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] Image awakeImg; |
| | | [SerializeField] Text awakeLVText; |
| | | [SerializeField] List<Image> starImgList; |
| | | [SerializeField] Image trainStateImg; |
| | | [SerializeField] RedpointBehaviour redpoint; |
| | | [SerializeField] Button bookLVBtn; |
| | | [SerializeField] GameObject unGetObj; |
| | | [SerializeField] GameObject activeObj; // 可激活带流光效果材质 |
| | | |
| | | string guid; |
| | | public void Display(int index) |
| | | public void Display(int index, int quality) |
| | | { |
| | | guid = HeroUIManager.Instance.heroSortList[index]; |
| | | var hero = HeroManager.Instance.GetHero(guid); |
| | | if (hero == null) |
| | | { |
| | | this.gameObject.SetActive(false); |
| | | return; |
| | | } |
| | | var heroID = HeroUIManager.Instance.heroCollectDict[quality][index]; |
| | | var heroConfig = HeroConfig.Get(heroID); |
| | | HB122_tagSCHeroInfo.tagSCHero colData; |
| | | HeroUIManager.Instance.TryGetHeroBookInfo(heroID, out colData); |
| | | heroCardBG.SetSprite("herocardbg" + heroConfig.Quality); |
| | | |
| | | this.gameObject.SetActive(true); |
| | | heroCardBG.SetSprite("herocardbg" + hero.Quality); |
| | | if (glowMaterial != null) |
| | | { |
| | | heroCardBG.material = glowMaterial; |
| | | } |
| | | lvText.text = Language.Get("L1094") + hero.heroLevel.ToString(); |
| | | var heroConfig = hero.heroConfig; |
| | | //分为0未获得、1可激活、2常规、3突破升级、4、星升级、5已满级 |
| | | int funcState = HeroUIManager.Instance.GetHeroBookState(heroID, quality); |
| | | |
| | | activeObj.SetActive(funcState == 1); |
| | | bookLVBtn.SetActive(funcState > 1); |
| | | unGetObj.SetActive(funcState == 0); |
| | | |
| | | countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country)); |
| | | jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class)); |
| | | heroModel.Create(heroConfig.SkinIDList[hero.SkinIndex], heroConfig.UIScale); |
| | | onStateImg.SetActive(hero.IsInTeamByTeamType(TeamType.Story)); |
| | | heroModel.Create(heroConfig.SkinIDList[0], heroConfig.UIScale); |
| | | |
| | | redpoint.redpointId = MainRedDot.HeroCardRedpoint * 1000 + hero.itemHero.gridIndex; |
| | | var funcState = hero.funcState; |
| | | if (funcState > 0) |
| | | redpoint.redpointId = MainRedDot.HeroCardCollectRedpoint * 10000000 + heroID; |
| | | |
| | | if (funcState == 3 || funcState == 4) |
| | | { |
| | | trainStateImg.SetActive(true); |
| | | trainStateImg.SetSprite("herofuncstate" + hero.funcState); |
| | | trainStateImg.SetSprite("herofuncstate2"); |
| | | } |
| | | else |
| | | { |
| | | trainStateImg.SetActive(false); |
| | | } |
| | | nameText.text = hero.breakLevel == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, hero.breakLevel); |
| | | awakeImg.SetActive(hero.awakeLevel > 0); |
| | | awakeLVText.text = hero.awakeLevel.ToString(); |
| | | nameText.text = colData.BookBreakLV == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, colData.BookBreakLV); |
| | | |
| | | for (int i = 0; i < starImgList.Count; i++) |
| | | { |
| | | if (hero.heroStar == 0 && i == 0) |
| | | if (colData.BookStarLV == 0 && i == 0) |
| | | { |
| | | // 无星级 特殊处理 |
| | | starImgList[i].SetActive(true); |
| | | starImgList[i].SetSprite("herostar" + hero.heroStar); |
| | | starImgList[i].SetSprite("herostar" + colData.BookStarLV); |
| | | } |
| | | else if ((hero.heroStar - 1) % starImgList.Count >= i) |
| | | else if ((colData.BookStarLV - 1) % starImgList.Count >= i) |
| | | { |
| | | starImgList[i].SetActive(true); |
| | | starImgList[i].SetSprite("herostar" + (((hero.heroStar - 1) / starImgList.Count) + 1) * starImgList.Count); |
| | | starImgList[i].SetSprite("herostar" + (((colData.BookStarLV - 1) / starImgList.Count) + 1) * starImgList.Count); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | heroCardBtn.AddListener(() => |
| | | { |
| | | HeroUIManager.Instance.selectHeroGuid = guid; |
| | | UIManager.Instance.OpenWindow<HeroTrainWin>(); |
| | | HeroUIManager.Instance.selectCollectHeroID = heroID; |
| | | var state = HeroUIManager.Instance.GetHeroBookState(heroID, quality); |
| | | if (state == 1 || state == 3 || state == 4) |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroCollectionLvUpWin>(); |
| | | } |
| | | }); |
| | | |
| | | bookLVBtn.AddListener(() => |
| | | { |
| | | HeroUIManager.Instance.selectCollectHeroID = heroID; |
| | | UIManager.Instance.OpenWindow<HeroCollectionLvUpWin>(); |
| | | }); |
| | | } |
| | | } |
| | |
| | | |
| | | public class HeroCollectionLineCell : CellView |
| | | { |
| | | [SerializeField] HeroCardCell[] cardList; |
| | | [SerializeField] HeroCollectionCardCell[] cardList; |
| | | |
| | | public void Display(int index) |
| | | public void Display(int index, int quality) |
| | | { |
| | | var _List = HeroUIManager.Instance.heroCollectDict[quality]; |
| | | for (int i = 0; i < cardList.Length; i++) |
| | | { |
| | | if (i + index < HeroUIManager.Instance.heroSortList.Count) |
| | | if (i + index < _List.Count) |
| | | { |
| | | cardList[i].SetActive(true); |
| | | cardList[i].Display(index + i); |
| | | cardList[i].Display(index + i, quality); |
| | | } |
| | | else |
| | | { |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 图鉴激活升级界面 |
| | | /// </summary> |
| | | public class HeroCollectionLvUpWin : UIBase |
| | | { |
| | | [SerializeField] GameObject lvupPanel; |
| | | [SerializeField] GameObject fullPanel; |
| | | |
| | | [SerializeField] HeroHeadBaseCell beforeHeadCell; |
| | | [SerializeField] Text name1; |
| | | [SerializeField] GameObject unActiveGo; |
| | | [SerializeField] HeroHeadBaseCell afterHeadCell; |
| | | [SerializeField] Text name2; |
| | | |
| | | [SerializeField] Text[] attrNames; |
| | | [SerializeField] Text[] beforeAttrValues; |
| | | [SerializeField] Text[] afterAttrValues; |
| | | |
| | | [SerializeField] RichText awardInfo; |
| | | [SerializeField] Button btn; |
| | | [SerializeField] Text btnText; |
| | | |
| | | [SerializeField] HeroHeadBaseCell fullHeadCell; |
| | | [SerializeField] Text name3; |
| | | [SerializeField] Text[] fullAttrs; |
| | | |
| | | [SerializeField] GameObject fullImg; |
| | | |
| | | [SerializeField] Text titleText; |
| | | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | btn.AddListener(OnBtnClick); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | HeroUIManager.Instance.OnHeroCollectEvent += Display; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | HeroUIManager.Instance.OnHeroCollectEvent -= Display; |
| | | } |
| | | |
| | | |
| | | void Display() |
| | | { |
| | | var state = HeroUIManager.Instance.GetHeroBookState(HeroUIManager.Instance.selectCollectHeroID, HeroConfig.Get(HeroUIManager.Instance.selectCollectHeroID).Quality); |
| | | var config = HeroConfig.Get(HeroUIManager.Instance.selectCollectHeroID); |
| | | |
| | | HB122_tagSCHeroInfo.tagSCHero colData; |
| | | HeroUIManager.Instance.TryGetHeroBookInfo(HeroUIManager.Instance.selectCollectHeroID, out colData); |
| | | var bookPer = HeroUIManager.Instance.GetHeroBookPer(HeroUIManager.Instance.selectCollectHeroID); |
| | | if (state == 5) |
| | | { |
| | | //已满级 |
| | | titleText.text = Language.Get("HeroAwake13"); |
| | | fullPanel.SetActive(true); |
| | | lvupPanel.SetActive(false); |
| | | |
| | | fullHeadCell.Init(HeroUIManager.Instance.selectCollectHeroID, config.SkinIDList[0], colData.BookStarLV); |
| | | name3.text = colData.BookBreakLV == 0 ? config.Name : Language.Get("herocardbreaklv", config.Name, colData.BookBreakLV); |
| | | |
| | | for (int i = 0; i < fullAttrs.Length; i++) |
| | | { |
| | | fullAttrs[i].text = PlayerPropertyConfig.GetFullDescription(PlayerPropertyConfig.basePerAttrs[i], |
| | | bookPer, "{0} " + UIHelper.AppendColor(TextColType.Green, "+{1}")); |
| | | } |
| | | var nextHeroID = HeroUIManager.Instance.FindHeroIDCanAddCollectAttr(HeroUIManager.Instance.selectCollectHeroID); |
| | | if (nextHeroID != 0) |
| | | { |
| | | fullImg.SetActive(false); |
| | | btn.SetActive(true); |
| | | //下一个 |
| | | btnText.text = Language.Get("HeroAwake14"); |
| | | } |
| | | else |
| | | { |
| | | fullImg.SetActive(true); |
| | | btn.SetActive(false); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | fullPanel.SetActive(false); |
| | | lvupPanel.SetActive(true); |
| | | btn.SetActive(true); |
| | | |
| | | beforeHeadCell.Init(HeroUIManager.Instance.selectCollectHeroID, config.SkinIDList[0], colData.BookStarLV); |
| | | name1.text = colData.BookBreakLV == 0 ? config.Name : Language.Get("herocardbreaklv", config.Name, colData.BookBreakLV); |
| | | |
| | | int addPer = 0; |
| | | var qualityConfig = HeroQualityConfig.Get(config.Quality); |
| | | awardInfo.text = string.Empty; |
| | | unActiveGo.SetActive(false); |
| | | titleText.text = Language.Get("HeroAwake12"); |
| | | int afterBreakLV = colData.BookBreakLV; |
| | | int afterStarLV = colData.BookStarLV; |
| | | if (state == 1) |
| | | { |
| | | //激活 |
| | | addPer = qualityConfig.BookInitAddPer; |
| | | btnText.text = Language.Get("L1131"); //L1131 激活 |
| | | awardInfo.text = Language.Get("HeroAwake10", UIHelper.GetIconNameWithMoneyType(HeroUIManager.Instance.bookMoneyType), |
| | | HeroUIManager.Instance.bookMoneyValue); |
| | | unActiveGo.SetActive(true); |
| | | titleText.text = Language.Get("HeroAwake11"); |
| | | } |
| | | else if (state == 3) |
| | | { |
| | | //突破 |
| | | addPer = qualityConfig.BookBreakLVAddPer; |
| | | btnText.text = Language.Get("L1109"); //升级 |
| | | afterBreakLV++; |
| | | } |
| | | else if (state == 4) |
| | | { |
| | | //升星 |
| | | addPer = qualityConfig.BookStarAddPer; |
| | | btnText.text = Language.Get("L1109"); |
| | | afterStarLV++; |
| | | } |
| | | else |
| | | { |
| | | var nextHeroID = HeroUIManager.Instance.FindHeroIDCanAddCollectAttr(HeroUIManager.Instance.selectCollectHeroID); |
| | | if (nextHeroID != 0) |
| | | { |
| | | //下一个 |
| | | btnText.text = Language.Get("HeroAwake14"); |
| | | } |
| | | else |
| | | { |
| | | btnText.text = Language.Get("L1109"); |
| | | } |
| | | } |
| | | |
| | | afterHeadCell.Init(HeroUIManager.Instance.selectCollectHeroID, config.SkinIDList[0], afterStarLV); |
| | | name2.text = afterBreakLV == 0 ? config.Name :Language.Get("herocardbreaklv", config.Name, afterBreakLV); |
| | | |
| | | |
| | | for (int i = 0; i < beforeAttrValues.Length; i++) |
| | | { |
| | | beforeAttrValues[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], bookPer); |
| | | attrNames[i].text = PlayerPropertyConfig.Get(PlayerPropertyConfig.basePerAttrs[i]).Name; |
| | | afterAttrValues[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], bookPer + addPer); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | void OnBtnClick() |
| | | { |
| | | var state = HeroUIManager.Instance.GetHeroBookState(HeroUIManager.Instance.selectCollectHeroID, HeroConfig.Get(HeroUIManager.Instance.selectCollectHeroID).Quality); |
| | | if (state == 1) |
| | | { |
| | | //激活 |
| | | SendPack(0); |
| | | } |
| | | else if (state == 3) |
| | | { |
| | | //突破 |
| | | SendPack(2); |
| | | } |
| | | else if (state == 4) |
| | | { |
| | | //升星 |
| | | SendPack(1); |
| | | } |
| | | else |
| | | { |
| | | var nextHeroID = HeroUIManager.Instance.FindHeroIDCanAddCollectAttr(HeroUIManager.Instance.selectCollectHeroID); |
| | | if (nextHeroID != 0) |
| | | { |
| | | //下一个 |
| | | HeroUIManager.Instance.selectCollectHeroID = nextHeroID; |
| | | Display(); |
| | | } |
| | | else |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroGift8"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | void SendPack(int type) |
| | | { |
| | | var pack = new CB237_tagCSHeroBookUP(); |
| | | pack.BookType = (byte)type; |
| | | pack.HeroID = (uint)HeroUIManager.Instance.selectCollectHeroID; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c8604af8282af244b8ed4d2943122bf6 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | |
| | | /// </summary> |
| | | public class HeroCollectionWin : UIBase |
| | | { |
| | | [SerializeField] Button heroPackBtn; |
| | | [SerializeField] Text heroPackText; |
| | | [SerializeField] ScrollerController heroListScroller; |
| | | [SerializeField] List<Text> totalAttrList; |
| | | [SerializeField] Button attrBtn; |
| | | [SerializeField] HeroSelectBehaviour fiterManager; //武将筛选 |
| | | |
| | | SinglePack singlePack; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | attrBtn.AddListener(() => |
| | | { |
| | | SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); |
| | | SmallTipWin.showText = Language.Get("herocard6"); |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | }); |
| | | |
| | | heroPackBtn.AddListener(() => |
| | | { |
| | | HeroUIManager.Instance.QueryUnLockHeroPack(); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | |
| | | singlePack = PackManager.Instance.GetSinglePack(PackType.Hero); |
| | | PackManager.Instance.gridRefreshEvent += GridRefreshEvent; |
| | | PackManager.Instance.RefreshItemEvent += RefreshItemEvent; |
| | | HeroUIManager.Instance.OnHeroCollectEvent += OnHeroCollectEvent; |
| | | heroListScroller.OnRefreshCell += OnRefreshCell; |
| | | HeroUIManager.Instance.selectHeroCollectListJob = 0; |
| | | HeroUIManager.Instance.selectHeroCollectListCountry = 0; |
| | | HeroUIManager.Instance.SortHeroCollectList(); |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | |
| | | PackManager.Instance.gridRefreshEvent -= GridRefreshEvent; |
| | | PackManager.Instance.RefreshItemEvent -= RefreshItemEvent; |
| | | HeroUIManager.Instance.OnHeroCollectEvent -= OnHeroCollectEvent; |
| | | heroListScroller.OnRefreshCell -= OnRefreshCell; |
| | | } |
| | | |
| | | |
| | | void Display() |
| | | { |
| | | fiterManager.Display(0, HeroUIManager.Instance.selectHeroCollectListJob, HeroUIManager.Instance.selectHeroCollectListCountry, SelectJobCountry); |
| | | |
| | | CreateScroller(); |
| | | RefreshTotalAttr(); |
| | | RefreshPackCount(); |
| | | } |
| | | |
| | | |
| | | void RefreshItemEvent(PackType type, int index, int itemID) |
| | | { |
| | | if (type != PackType.Hero) |
| | | return; |
| | | |
| | | |
| | | RefreshPackCount(); |
| | | |
| | | } |
| | | |
| | | void RefreshPackCount() |
| | | { |
| | | int count = singlePack.GetAllItems().Count; |
| | | heroPackText.text = UIHelper.AppendColor(count >= singlePack.unlockedGridCount ? TextColType.Red : TextColType.NavyBrown, |
| | | string.Format("{0}/{1}", count, singlePack.unlockedGridCount)); |
| | | |
| | | } |
| | | |
| | | void GridRefreshEvent(PackType type) |
| | | { |
| | | if (type != PackType.Hero) |
| | | return; |
| | | |
| | | RefreshPackCount(); |
| | | } |
| | | |
| | | |
| | | void RefreshTotalAttr() |
| | | { |
| | | for (int i = 0; i < totalAttrList.Count; i++) |
| | | { |
| | | totalAttrList[i].text = PlayerPropertyConfig.GetFullDescription(PlayerPropertyConfig.basePerAttrs[i], |
| | | HeroUIManager.Instance.allHeroBookPer); |
| | | } |
| | | } |
| | | |
| | | |
| | | void SelectJobCountry(int job, int country) |
| | | { |
| | | HeroUIManager.Instance.selectHeroCollectListJob = job; |
| | | HeroUIManager.Instance.selectHeroCollectListCountry = country; |
| | | HeroUIManager.Instance.SortHeroCollectList(); |
| | | CreateScroller(); |
| | | } |
| | | |
| | | |
| | | void CreateScroller() |
| | | { |
| | | heroListScroller.Refresh(); |
| | | var _List = HeroUIManager.Instance.heroCollectDict.Keys.ToList(); |
| | | _List.Reverse(); |
| | | for (int i = 0; i < _List.Count; i++) |
| | | { |
| | | var ids = HeroUIManager.Instance.heroCollectDict[_List[i]]; |
| | | if (ids.Count == 0) |
| | | continue; |
| | | //品质 |
| | | heroListScroller.AddCell(ScrollerDataType.Header, _List[i]); |
| | | //武将 |
| | | for (int j = 0; j < ids.Count; j++) |
| | | { |
| | | if (j % 4 == 0) |
| | | { |
| | | CellInfo cellInfo = new CellInfo(); |
| | | cellInfo.infoInt1 = _List[i]; |
| | | heroListScroller.AddCell(ScrollerDataType.Normal, j, cellInfo); |
| | | } |
| | | } |
| | | } |
| | | heroListScroller.Restart(); |
| | | } |
| | | |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | if (type == ScrollerDataType.Header) |
| | | { |
| | | var _cell = cell.GetComponent<Image>(); |
| | | _cell.SetSprite("herocoltitle" + cell.index); |
| | | } |
| | | else if (type == ScrollerDataType.Normal) |
| | | { |
| | | var _cell = cell as HeroCollectionLineCell; |
| | | _cell?.Display(cell.index, cell.info.Value.infoInt1); |
| | | |
| | | } |
| | | } |
| | | |
| | | void OnHeroCollectEvent() |
| | | { |
| | | RefreshTotalAttr(); |
| | | heroListScroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 武将培养界面 |
| | | /// 武将遣散界面 |
| | | /// </summary> |
| | | public class HeroDeleteWin : UIBase |
| | | { |
| | |
| | | HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectDeleteHeroList[i]); |
| | | if (hero == null) |
| | | continue; |
| | | if (hero.heroStar > 1) |
| | | if (hero.heroStarMaxBefore > 1) |
| | | { |
| | | hasStarHero = true; |
| | | break; |
| | |
| | | { |
| | | if (!tmpDict.ContainsKey(itemInfo[0])) |
| | | { |
| | | tmpDict.Add(itemInfo[0], itemInfo[1] * (1 + hero.heroStar)); |
| | | tmpDict.Add(itemInfo[0], itemInfo[1] * (1 + hero.heroStarMaxBefore)); |
| | | } |
| | | else |
| | | { |
| | | tmpDict[itemInfo[0]] += itemInfo[1] * (1 + hero.heroStar); |
| | | tmpDict[itemInfo[0]] += itemInfo[1] * (1 + hero.heroStarMaxBefore); |
| | | } |
| | | } |
| | | |
| | | allItemDict = CommonFunc.AddDict(allItemDict, tmpDict); |
| | | } |
| | | |
| | | //计算返还比例 |
| | | var _list = allItemDict.Keys.ToList(); |
| | | foreach (var key in _list) |
| | | { |
| | | allItemDict[key] = Math.Max((long)(allItemDict[key] * HeroUIManager.Instance.deletePayBackPer / 100.0), 1); |
| | | } |
| | | |
| | | |
| | | |
| | | List<Item> items = CommonFunc.ChangeToItemList(allItemDict); |
| | | ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard25"), Language.Get("herocard26"), (bool isOk) => |
| | |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | HeroUIManager.Instance.selectDeleteHeroList.Clear(); |
| | | } |
| | | }); |
| | | }, itemName:$"( {HeroUIManager.Instance.deletePayBackPer}% )"); |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | if (index < configList.Count) |
| | | { |
| | | var giftID = configList[index]; |
| | | var giftID = configList[index + i]; |
| | | var giftLV = HeroUIManager.Instance.maxGiftLevel; |
| | | cardList[i].SetActive(true); |
| | | cardList[i].Init(giftID, giftLV); |
| | |
| | | return; |
| | | } |
| | | |
| | | if (hero.heroLevel > 1) |
| | | { |
| | | HeroUIManager.Instance.ResetBtnClick(hero); |
| | | return; |
| | | } |
| | | |
| | | |
| | | if (hero.heroStar > 0) |
| | | { |
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), |
| | |
| | | scroller.OnRefreshCell += Scroller_OnRefreshCell; |
| | | TeamManager.Instance.OnTeamChange += OnTeamChange; |
| | | PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent; |
| | | HeroManager.Instance.onHeroChangeEvent += OnHeroChangeEvent; |
| | | Display(); |
| | | } |
| | | |
| | |
| | | scroller.OnRefreshCell -= Scroller_OnRefreshCell; |
| | | TeamManager.Instance.OnTeamChange -= OnTeamChange; |
| | | PackManager.Instance.RefreshItemLockEvent -= RefreshItemLockEvent; |
| | | HeroManager.Instance.onHeroChangeEvent -= OnHeroChangeEvent; |
| | | HeroUIManager.Instance.heroEatList.Clear(); |
| | | } |
| | | |
| | |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | void OnHeroChangeEvent(HeroInfo hero) |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | } |
| | |
| | | int giftID = hero.talentIDList[index]; |
| | | int giftLV = hero.talentLvList[index]; |
| | | |
| | | giftCell.Init(giftID, giftLV); |
| | | giftCell.Init(giftID, giftLV, 0, hero.heroId, index, hero.awakeLevel); |
| | | |
| | | if (hero.talentLockList.IndexOf(index) != -1) |
| | | { |
| | |
| | | return; |
| | | } |
| | | |
| | | //洗炼和觉醒的天赋未处理不可吞噬 |
| | | if (hero.talentRandomIDList.Count > 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroGift4"); |
| | | return; |
| | | } |
| | | |
| | | if (hero.talentAwakeRandomIDList.Count > 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroGift5"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | //根据锁状态判断材料是否足够 |
| | | if (!ItemLogicUtility.CheckItemCount(PackType.Item, HeroUIManager.Instance.washItemID, |
| | | HeroUIManager.Instance.GetTalentLockUseWashCount(hero), 2)) |
| | |
| | | afterGiftCells[i].SetActive(true); |
| | | |
| | | |
| | | afterGiftCells[i].Init(hero.talentRandomIDList[i], hero.talentLvList[i]); |
| | | afterGiftCells[i].Init(hero.talentRandomIDList[i], hero.talentLvList[i], 0, hero.heroId, i, hero.awakeLevel); |
| | | |
| | | //对比变化的天赋显示特效 |
| | | if (hero.talentRandomIDList[i] != hero.talentIDList[i]) |
| | |
| | | return m_LvTextOutline; |
| | | } |
| | | } |
| | | |
| | | Button m_StarBtn; |
| | | Button starBtn |
| | | { |
| | | get |
| | | { |
| | | if (m_StarBtn == null) |
| | | { |
| | | m_StarBtn = this.transform.GetComponent<Button>("Container_HeroShow/layout/layout/stars"); |
| | | } |
| | | return m_StarBtn; |
| | | } |
| | | } |
| | | |
| | | |
| | | void Awake() |
| | | { |
| | | LoadPrefab(); |
| | |
| | | heroLVOutline.colorType = awakelv == 0 ? QualityTextColType.None : QualityTextColType.red; |
| | | } |
| | | |
| | | starBtn.AddListener(() => |
| | | { |
| | | SmallTipWin.showText = Language.Get("HeroGift14", star); |
| | | SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | }); |
| | | } |
| | | |
| | | GameObject cellContainer; |
| | |
| | | /// </summary> |
| | | public class HeroTrainWin : UIBase |
| | | { |
| | | [SerializeField] RawImage bgTexture; |
| | | [SerializeField] Button showFuncBtn; //只显示立绘时点击,显示功能 |
| | | [SerializeField] Transform funcForm; |
| | | [SerializeField] UIHeroController roleLhModel; //展示英雄立绘 |
| | |
| | | [SerializeField] Text starUPBtnText; |
| | | [SerializeField] Button washBtn; |
| | | |
| | | //冻结处理 |
| | | [SerializeField] Button freezeTipBtn; |
| | | [SerializeField] GameObject freezeTipGo; |
| | | [SerializeField] Text freezeStarText; |
| | | [SerializeField] Text freezeAawkeLVText; |
| | | [SerializeField] List<Image> starImgFreezeList; |
| | | |
| | | string guid; |
| | | HeroInfo hero; |
| | |
| | | }); |
| | | |
| | | lockBtn.AddListener(() => { hero.ChangeLockState(); }); |
| | | resetBtn.AddListener(ResetBtnClick); |
| | | resetBtn.AddListener(() => |
| | | { |
| | | HeroUIManager.Instance.ResetBtnClick(hero); |
| | | }); |
| | | deleteBtn.AddListener(DeleteHero); |
| | | awakeBtn.AddListener(() => |
| | | { |
| | |
| | | |
| | | potentialCellList = new List<GameObject>(); |
| | | awakeCellList = new List<GameObject>(); |
| | | |
| | | freezeTipBtn.AddListener(() => |
| | | { |
| | | freezeTipGo.SetActive(!freezeTipGo.activeSelf); |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent; |
| | | HeroManager.Instance.onHeroChangeEvent += RefreshHeroEvent; |
| | | UIManager.Instance.OnCloseWindow += OnCloseWindow; |
| | | HeroUIManager.Instance.OnTeamPosChangeEvent += TeamPosChangeEvent; |
| | | TeamManager.Instance.OnTeamChange += TeamPosChangeEvent; |
| | | guid = HeroUIManager.Instance.selectHeroGuid; |
| | | hero = HeroManager.Instance.GetHero(guid); |
| | | unfoldState = false; |
| | |
| | | PackManager.Instance.RefreshItemLockEvent -= RefreshItemLockEvent; |
| | | HeroManager.Instance.onHeroChangeEvent -= RefreshHeroEvent; |
| | | UIManager.Instance.OnCloseWindow -= OnCloseWindow; |
| | | HeroUIManager.Instance.OnTeamPosChangeEvent -= TeamPosChangeEvent; |
| | | TeamManager.Instance.OnTeamChange -= TeamPosChangeEvent; |
| | | } |
| | | |
| | | private void OnCloseWindow(UIBase closeUI) |
| | |
| | | |
| | | public void Display() |
| | | { |
| | | bgTexture.SetTexture2D("countryBG" + hero.heroConfig.Country); |
| | | roleLhModel.Create(hero.SkinID, 1, motionName: "", isLh: true); |
| | | roleXsModel.Create(hero.SkinID); |
| | | jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(hero.heroConfig.Class)); |
| | |
| | | RefreshFetter(); |
| | | RefreshGift(); |
| | | RefreshAwake(); |
| | | RefreshFreeze(); |
| | | } |
| | | |
| | | void RefreshItemLockEvent(PackType type, string guid, bool lockState) |
| | |
| | | Display(); |
| | | } |
| | | |
| | | void ResetBtnClick() |
| | | { |
| | | //升级、突破、觉醒 |
| | | if (hero.heroLevel == 1 && hero.breakLevel == 0 && hero.awakeLevel == 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroCanNotReset"); |
| | | return; |
| | | } |
| | | |
| | | List<Item> items = new List<Item>(); |
| | | |
| | | |
| | | var payBack1 = CommonFunc.AddDict(HeroUIManager.Instance.GetHeroLVPayBack(hero.Quality, hero.heroLevel), |
| | | HeroUIManager.Instance.GetHeroBreakPayBack(hero.Quality, hero.breakLevel)); |
| | | |
| | | //已觉醒的需要消耗货币 |
| | | if (hero.awakeLevel == 0) |
| | | { |
| | | items = CommonFunc.ChangeToItemList(payBack1); |
| | | ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) => |
| | | { |
| | | if (isOk) |
| | | { |
| | | //发包 |
| | | SendReborn(hero.itemHero.gridIndex); |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | |
| | | if (HeroUIManager.Instance.awakeRebirthCnt >= HeroUIManager.Instance.rebornAwakeHeroMaxCount) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroRebornAwakeMax"); |
| | | return; |
| | | } |
| | | |
| | | payBack1 = CommonFunc.AddDict(payBack1, HeroUIManager.Instance.GetHeroQualityAwakePayBack(hero.Quality, hero.awakeLevel)); |
| | | items = CommonFunc.ChangeToItemList(payBack1); |
| | | var info2 = Language.Get("herocard44", HeroUIManager.Instance.rebornAwakeHeroMaxCount - HeroUIManager.Instance.awakeRebirthCnt); |
| | | var payBackMoney = HeroQualityAwakeConfig.GetQualityAwakeConfig(hero.Quality, hero.awakeLevel).RebirthCostMoney; |
| | | ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) => |
| | | { |
| | | if (isOk) |
| | | { |
| | | if (UIHelper.GetMoneyCnt(HeroUIManager.Instance.payBackMoneyType) < payBackMoney) |
| | | { |
| | | ItemTipUtility.ShowMoneyTip(HeroUIManager.Instance.payBackMoneyType); |
| | | return; |
| | | } |
| | | //发包 |
| | | SendReborn(hero.itemHero.gridIndex); |
| | | } |
| | | }, info2, "", payBackMoney, HeroUIManager.Instance.payBackMoneyType); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | void SendReborn(int index) |
| | | { |
| | | var pack = new CB239_tagCSHeroRebirth(); |
| | | pack.ItemIndex = (ushort)index; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | |
| | | HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculatePower(false)); |
| | | |
| | | } |
| | | |
| | | void DeleteHero() |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | void TeamPosChangeEvent(List<int> posList, int flyFrom, Vector3 startPos) |
| | | void TeamPosChangeEvent(TeamType teamType) |
| | | { |
| | | if (teamType != TeamType.Story) |
| | | return; |
| | | fightPowerText.text = UIHelper.ReplaceLargeArtNum(hero.CalculatePower()); |
| | | } |
| | | |
| | | void RefreshFreeze() |
| | | { |
| | | //至少需要觉醒到多少级 |
| | | int needAwakeLV = HeroUIManager.Instance.GetAwakeLVByStarLV(hero.heroId, hero.heroStarMaxBefore); |
| | | if (hero.awakeLevel < needAwakeLV) |
| | | { |
| | | freezeTipBtn.SetActive(true); |
| | | //星级 |
| | | for (int i = 0; i < starImgFreezeList.Count; i++) |
| | | { |
| | | if ((hero.heroStarMaxBefore - 1) % starImgFreezeList.Count >= i) |
| | | { |
| | | starImgFreezeList[i].SetActive(true); |
| | | starImgFreezeList[i].SetSprite("herostar" + (((hero.heroStarMaxBefore - 1) / starImgFreezeList.Count) + 1) * starImgFreezeList.Count); |
| | | } |
| | | else |
| | | { |
| | | starImgFreezeList[i].SetActive(false); |
| | | } |
| | | } |
| | | freezeStarText.text = Language.Get("HeroAwake16", hero.heroStarMaxBefore); |
| | | freezeAawkeLVText.text = Language.Get("HeroAwake17", needAwakeLV); |
| | | |
| | | } |
| | | else |
| | | { |
| | | freezeTipBtn.SetActive(false); |
| | | } |
| | | |
| | | freezeTipGo.SetActive(false); |
| | | } |
| | | } |
| | |
| | | public List<int> heroBeforeAwakeGiftIDList = new List<int>(); //会有重复的ID,不要用字典 |
| | | public List<int> heroBeforeAwakeGiftLevelList = new List<int>(); |
| | | |
| | | |
| | | //达到X星需要的觉醒等级 |
| | | public int GetAwakeLVByStarLV(int heroID, int starLV) |
| | | { |
| | | var config = HeroConfig.Get(heroID); |
| | | var starCnt = HeroQualityConfig.Get(config.Quality).InitStarUpper; |
| | | if (starLV <= starCnt) |
| | | return 0; |
| | | |
| | | Dictionary<int, HeroAwakeConfig> tempDic = null; |
| | | if (!HeroAwakeConfig.configDics.TryGetValue(heroID, out tempDic)) |
| | | { |
| | | return 0; |
| | | } |
| | | foreach (var item in tempDic) |
| | | { |
| | | starCnt += item.Value.AddStarUpper; |
| | | if (starCnt >= starLV) |
| | | { |
| | | return item.Key; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | |
| | | using UnityEngine; |
| | | |
| | | //图鉴和皮肤 |
| | | public partial class HeroUIManager : GameSystemManager<HeroUIManager> |
| | | { |
| | | |
| | | #region 图鉴和皮肤 |
| | | |
| | | public Dictionary<int, List<int>> heroCollectDict { get; private set; } = new Dictionary<int, List<int>>(); //武将图鉴按品质列表 |
| | | public int selectHeroCollectListJob = 0; //武将列表界面 筛选职业 |
| | | public int selectHeroCollectListCountry = 0; //武将列表界面筛选国家 |
| | | public int selectCollectHeroID; //选中的武将id |
| | | |
| | | public int bookMoneyType; //图鉴奖励货币类型 |
| | | public int bookMoneyValue;//图鉴奖励货币数量 |
| | | |
| | | |
| | | //图鉴和皮肤的激活情况 |
| | | public Dictionary<int, HB122_tagSCHeroInfo.tagSCHero> heroCollectInfoDic { get; private set; } = new Dictionary<int, HB122_tagSCHeroInfo.tagSCHero>(); |
| | | Dictionary<int, HB122_tagSCHeroInfo.tagSCHero> heroCollectInfoDic = new Dictionary<int, HB122_tagSCHeroInfo.tagSCHero>(); |
| | | |
| | | public int bookPer; |
| | | public int allHeroBookPer; //全体武将的图鉴激活百分比 |
| | | public event Action OnHeroCollectEvent; |
| | | |
| | | public void UpdateHeroCollectInfo(HB122_tagSCHeroInfo netPack) |
| | |
| | | { |
| | | heroCollectInfoDic[(int)netPack.HeroInfoList[i].HeroID] = netPack.HeroInfoList[i]; |
| | | } |
| | | bookPer = GetHeroCollectBookPer(); |
| | | allHeroBookPer = GetHeroCollectBookPer(); |
| | | OnHeroCollectEvent?.Invoke(); |
| | | } |
| | | |
| | |
| | | return per; |
| | | } |
| | | |
| | | public HB122_tagSCHeroInfo.tagSCHero GetHeroBookInfo(int heroID) |
| | | public bool TryGetHeroBookInfo(int heroID, out HB122_tagSCHeroInfo.tagSCHero heroData) |
| | | { |
| | | if (heroCollectInfoDic.ContainsKey(heroID)) |
| | | { |
| | | return heroCollectInfoDic[heroID]; |
| | | heroData = heroCollectInfoDic[heroID]; |
| | | return true; |
| | | } |
| | | return null; |
| | | heroData = new HB122_tagSCHeroInfo.tagSCHero(); |
| | | return false; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | public void SortHeroCollectList() |
| | | { |
| | | var heroIDs = HeroConfig.GetKeys().ToList(); |
| | | |
| | | heroCollectDict.Clear(); |
| | | foreach (var heroID in heroIDs) |
| | | { |
| | | HeroConfig heroConfig = HeroConfig.Get(heroID); |
| | | if (!heroCollectDict.ContainsKey(heroConfig.Quality)) |
| | | { |
| | | heroCollectDict[heroConfig.Quality] = new List<int>(); |
| | | } |
| | | //过滤职业国家 |
| | | if (selectHeroCollectListJob != 0 && selectHeroCollectListJob != heroConfig.Class) |
| | | { |
| | | continue; |
| | | } |
| | | if (selectHeroCollectListCountry != 0 && selectHeroCollectListCountry != heroConfig.Country) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | heroCollectDict[heroConfig.Quality].Add(heroID); |
| | | } |
| | | } |
| | | |
| | | //图鉴总上限等级 = 图鉴星级上限 + 图鉴突破上限 |
| | | public int GetHeroBookMaxLevel(int heroID, int quality) |
| | | { |
| | | return GetMaxStarCount(heroID, quality) + HeroBreakConfig.GetMaxBreakLv(heroID); |
| | | } |
| | | |
| | | public int GetHeroBookLevel(int heroID) |
| | | { |
| | | if (heroCollectInfoDic.ContainsKey(heroID)) |
| | | { |
| | | return heroCollectInfoDic[heroID].BookStarLV + heroCollectInfoDic[heroID].BookBreakLV; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | //分为0未获得、1可激活、2常规、3突破升级、4、星升级、5已满级 |
| | | public int GetHeroBookState(int heroID, int quality) |
| | | { |
| | | int funcState = 0; |
| | | |
| | | HB122_tagSCHeroInfo.tagSCHero colData; |
| | | TryGetHeroBookInfo(heroID, out colData); |
| | | int maxBreakLV = colData.BookBreakLVH; //历史最高突破等级 |
| | | int maxStarLV = colData.BookStarLVH; //历史最高星级 |
| | | |
| | | if (colData.BookInitState == 0) |
| | | { |
| | | funcState = 0; |
| | | } |
| | | else if (colData.BookInitState == 1) |
| | | { |
| | | funcState = 1; |
| | | } |
| | | else if (colData.BookInitState == 2) |
| | | { |
| | | if (GetHeroBookMaxLevel(heroID, quality) == colData.BookBreakLV + colData.BookStarLV) |
| | | { |
| | | funcState = 5; |
| | | } |
| | | else if (maxBreakLV + maxStarLV == colData.BookBreakLV + colData.BookStarLV) |
| | | { |
| | | funcState = 2; |
| | | } |
| | | else |
| | | { |
| | | //优先突破升级 |
| | | if (colData.BookBreakLV < colData.BookBreakLVH) |
| | | { |
| | | funcState = 3; |
| | | } |
| | | else |
| | | { |
| | | funcState = 4; |
| | | } |
| | | } |
| | | |
| | | } |
| | | return funcState; |
| | | } |
| | | |
| | | //找到可以操作的图鉴武将 |
| | | public int FindHeroIDCanAddCollectAttr(int excludeHeroID = 0) |
| | | { |
| | | foreach (var kv in heroCollectInfoDic) |
| | | { |
| | | if (kv.Key == excludeHeroID) |
| | | continue; |
| | | var state = GetHeroBookState(kv.Key, HeroConfig.Get(kv.Key).Quality); |
| | | if (state == 1 || state == 3 || state == 4) |
| | | { |
| | | return kv.Key; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public int GetHeroBookPer(int heroID) |
| | | { |
| | | var config = HeroQualityConfig.Get(HeroConfig.Get(heroID).Quality); |
| | | HB122_tagSCHeroInfo.tagSCHero heroData; |
| | | TryGetHeroBookInfo(heroID, out heroData); |
| | | if (heroData.BookInitState < 2) |
| | | { |
| | | return 0; |
| | | } |
| | | return config.BookInitAddPer + heroData.BookStarLV * config.BookStarAddPer + heroData.BookBreakLV * config.BookBreakLVAddPer; |
| | | } |
| | | } |
| | | |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | |
| | | using UnityEngine; |
| | | |
| | | //重生 遣散 |
| | | public partial class HeroUIManager : GameSystemManager<HeroUIManager> |
| | | { |
| | | |
| | | |
| | | #region 重生 遣散 |
| | | public int awakeRebirthCnt { get; private set; } |
| | | public int payBackMoneyType; |
| | | public int rebornAwakeHeroMaxCount; //觉醒武将每日的最大重生次数 |
| | | public string rebornFormula; //重生等级重置的消耗,参数 heroLV武将等级,最终消耗为公式+觉醒消耗 |
| | | public int rebornPayBackPer; //重生返还的百分比 |
| | | public int deletePayBackPer; //遣散返还的百分比 |
| | | |
| | | public List<string> heroDeleteSortList { get; private set; } = new List<string>(); |
| | | public int selectHeroDeleteListJob = 0; //筛选职业 |
| | |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | public void ResetBtnClick(HeroInfo hero) |
| | | { |
| | | //升级、突破、觉醒 |
| | | if (hero.heroLevel == 1 && hero.breakLevel == 0 && hero.awakeLevel == 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroCanNotReset"); |
| | | return; |
| | | } |
| | | |
| | | //洗炼和觉醒的天赋未处理不可吞噬 |
| | | if (hero.talentRandomIDList.Count > 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroGift4"); |
| | | return; |
| | | } |
| | | |
| | | if (hero.talentAwakeRandomIDList.Count > 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroGift5"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | List<Item> items = new List<Item>(); |
| | | var payBack1 = CommonFunc.AddDict(GetHeroLVPayBack(hero.Quality, hero.heroLevel), GetHeroBreakPayBack(hero.Quality, hero.breakLevel)); |
| | | |
| | | Dictionary<string, double> rebornParam = new Dictionary<string, double>(); //重生消耗公式参数 |
| | | //先计算有没消耗 |
| | | rebornParam.Add("heroLV", hero.heroLevel); |
| | | int costCnt = (int)JaceCalculator.Calculate(rebornFormula, rebornParam); |
| | | |
| | | //重生等级重置的消耗,参数 heroLV武将等级,最终消耗为公式+觉醒消耗 |
| | | if (hero.awakeLevel == 0) |
| | | { |
| | | //计算返还比例 |
| | | var _list = payBack1.Keys.ToList(); |
| | | foreach (var key in _list) |
| | | { |
| | | payBack1[key] = Math.Max((long)(payBack1[key] * rebornPayBackPer / 100.0), 1); |
| | | } |
| | | |
| | | items = CommonFunc.ChangeToItemList(payBack1); |
| | | |
| | | if (costCnt == 0) |
| | | { |
| | | //无消耗显示 |
| | | ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) => |
| | | { |
| | | if (isOk) |
| | | { |
| | | //发包 |
| | | SendReborn(hero); |
| | | } |
| | | }, itemName:$"( {rebornPayBackPer}% )"); |
| | | } |
| | | else |
| | | { |
| | | //有消耗显示 |
| | | ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) => |
| | | { |
| | | if (isOk) |
| | | { |
| | | if (UIHelper.GetMoneyCnt(payBackMoneyType) < costCnt) |
| | | { |
| | | ItemTipUtility.ShowMoneyTip(payBackMoneyType); |
| | | return; |
| | | } |
| | | //发包 |
| | | SendReborn(hero); |
| | | } |
| | | }, "", "", costCnt, payBackMoneyType, $"( {rebornPayBackPer}% )"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | | if (awakeRebirthCnt >= rebornAwakeHeroMaxCount) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroRebornAwakeMax"); |
| | | return; |
| | | } |
| | | |
| | | payBack1 = CommonFunc.AddDict(payBack1, GetHeroQualityAwakePayBack(hero.Quality, hero.awakeLevel)); |
| | | |
| | | //计算返还比例 |
| | | var _list = payBack1.Keys.ToList(); |
| | | foreach (var key in _list) |
| | | { |
| | | payBack1[key] = Math.Max((long)(payBack1[key] * rebornPayBackPer / 100.0), 1); |
| | | } |
| | | |
| | | |
| | | items = CommonFunc.ChangeToItemList(payBack1); |
| | | var info2 = Language.Get("herocard44", rebornAwakeHeroMaxCount - awakeRebirthCnt); |
| | | var payBackMoney = HeroQualityAwakeConfig.GetQualityAwakeConfig(hero.Quality, hero.awakeLevel).RebirthCostMoney + costCnt; |
| | | ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) => |
| | | { |
| | | if (isOk) |
| | | { |
| | | if (UIHelper.GetMoneyCnt(payBackMoneyType) < payBackMoney) |
| | | { |
| | | ItemTipUtility.ShowMoneyTip(payBackMoneyType); |
| | | return; |
| | | } |
| | | //发包 |
| | | SendReborn(hero); |
| | | } |
| | | }, info2, "", payBackMoney, payBackMoneyType, $"( {rebornPayBackPer}% )"); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | void SendReborn(HeroInfo hero) |
| | | { |
| | | var pack = new CB239_tagCSHeroRebirth(); |
| | | pack.ItemIndex = (ushort)hero.itemHero.gridIndex; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | |
| | | lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculatePower(false)); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | giftBaseCells[i].Init(giftID, giftLV, null, state); |
| | | giftBaseCells[i].Init(giftID, giftLV, state, hero.heroId, i, hero.awakeLevel); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | int index = i; |
| | | giftBaseCells[i].Init(-1, 0, null, hero.heroId, index); |
| | | giftBaseCells[i].Init(-1, 0, 0, hero.heroId, i); |
| | | } |
| | | } |
| | | |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using LitJson; |
| | | |
| | | using UnityEngine; |
| | | |
| | |
| | | var config = FuncConfigConfig.Get("HeroRebirth"); |
| | | payBackMoneyType = int.Parse(config.Numerical1); |
| | | rebornAwakeHeroMaxCount = int.Parse(config.Numerical2); |
| | | rebornFormula = config.Numerical3; |
| | | rebornPayBackPer = int.Parse(config.Numerical4); |
| | | deletePayBackPer = int.Parse(config.Numerical5); |
| | | |
| | | ParseGiftConfig(); |
| | | |
| | | config = FuncConfigConfig.Get("HeroBook"); |
| | | var arr = JsonMapper.ToObject<int[]>(config.Numerical1); |
| | | bookMoneyType = arr[0]; |
| | | bookMoneyValue = arr[1]; |
| | | } |
| | | |
| | | public void OnBeforePlayerDataInitialize() |
| | |
| | | |
| | | public bool IsNewHero(int heroID) |
| | | { |
| | | var bookInfo = GetHeroBookInfo(heroID); |
| | | if (bookInfo != null) |
| | | HB122_tagSCHeroInfo.tagSCHero bookInfo; |
| | | if (TryGetHeroBookInfo(heroID, out bookInfo)) |
| | | { |
| | | if (bookInfo.BookInitState < 2) |
| | | { |
| | |
| | | { |
| | | return 0; |
| | | } |
| | | return HeroUIManager.Instance.bookPer; |
| | | return HeroUIManager.Instance.allHeroBookPer; |
| | | } |
| | | |
| | | int GetCountryPer(int attrType) |
| | |
| | | } |
| | | if (config.showType == 1) |
| | | { |
| | | fightPowerVariables[config.Parameter] = (ulong)GetPropertyVaule(config.ID, hero, propertyFormula); |
| | | fightPowerVariables[config.Parameter] = GetPropertyVaule(config.ID, hero, propertyFormula); |
| | | } |
| | | else |
| | | { |
| | | fightPowerVariables[config.Parameter] = (ulong)GetPropertyVaule(config.ID, hero, fightPropertyFormula); |
| | | fightPowerVariables[config.Parameter] = GetPropertyVaule(config.ID, hero, fightPropertyFormula); |
| | | } |
| | | } |
| | | |
| | |
| | |
|
| | | //武将卡
|
| | | public const int HeroCardRedpoint = 200;
|
| | | public Redpoint HeroCardRedpoint1 = new Redpoint(MainHerosRedpoint, HeroCardRedpoint);
|
| | | public Redpoint HeroListRedpoint = new Redpoint(MainHerosRedpoint, HeroCardRedpoint);
|
| | | public const int HeroCardCollectRedpoint = 201;
|
| | | public Redpoint HeroCollectRedpoint = new Redpoint(MainHerosRedpoint, HeroCardCollectRedpoint);
|
| | |
|
| | |
|
| | | #region 邮件红点
|
| | |
| | | public static string generalItemTip2; |
| | | |
| | | public static List<Item> getItems { get; private set; } |
| | | public static string replaceItemName; |
| | | /// <summary> |
| | | /// 多物品确认框 |
| | | /// </summary> |
| | |
| | | /// <param name="moneyCnt"></param> |
| | | /// <param name="type"></param> |
| | | public static void ShowItemsConfirm(List<Item> items, string tiltle, string info, Action<bool> func, |
| | | string info2 = "", string btnText = "", int moneyCnt = 0, int type = 0) |
| | | string info2 = "", string btnText = "", int moneyCnt = 0, int type = 0, string itemName = "") |
| | | { |
| | | getItems = items; |
| | | generalTitle = tiltle; |
| | |
| | | OnPopConfirmClickEvent = func; |
| | | moneyType = type; |
| | | moneyNeedCount = moneyCnt; |
| | | replaceItemName = itemName; |
| | | if (!UIManager.Instance.IsOpened<ItemsConfirmWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindow<ItemsConfirmWin>(); |
| | |
| | | [SerializeField] ItemCell itemCell;
|
| | | [SerializeField] Text itemName;
|
| | |
|
| | | public void Display(int index)
|
| | | public void Display(int index, string replaceItemName)
|
| | | {
|
| | | int itemID = ConfirmCancel.getItems[index].id;
|
| | | itemCell.Init(new ItemCellModel(itemID, false, ConfirmCancel.getItems[index].countEx));
|
| | |
| | | {
|
| | | ItemTipUtility.Show(itemID);
|
| | | });
|
| | | itemName.text = ItemConfig.Get(itemID).ItemName;
|
| | | itemName.text = string.IsNullOrEmpty(replaceItemName) ? ItemConfig.Get(itemID).ItemName : replaceItemName;
|
| | | }
|
| | | }
|
| | |
| | | m_ConfirmBtn.AddListener(ConfirmBtn);
|
| | | m_CancleBtn.AddListener( ()=>
|
| | | {
|
| | | ConfirmCancel.OnPopConfirmClickEvent?.Invoke(false);
|
| | | CloseWindow();
|
| | | ConfirmCancel.OnPopConfirmClickEvent?.Invoke(false);
|
| | | });
|
| | | }
|
| | |
|
| | |
| | |
|
| | | private void ConfirmBtn()
|
| | | {
|
| | | ConfirmCancel.OnPopConfirmClickEvent?.Invoke(true);
|
| | | CloseWindow();
|
| | | ConfirmCancel.OnPopConfirmClickEvent?.Invoke(true);
|
| | | }
|
| | |
|
| | |
|
| | | void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var _cell = cell as ItemsConfirmCell;
|
| | | _cell?.Display(cell.index);
|
| | | _cell?.Display(cell.index, ConfirmCancel.replaceItemName);
|
| | | }
|
| | |
|
| | | void CreateScroller()
|
| | |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError("MoneyDisplayModel 为配置货币类型:" + moneyType); |
| | | Debug.LogError("MoneyDisplayModel 未配置货币类型:" + moneyType); |
| | | return ""; |
| | | } |
| | | } |