| | |
| | | HashSet<Type> configTypes = new HashSet<Type>() {
|
| | | typeof(ADAwardConfig),
|
| | | typeof(BattleMapConfig),
|
| | | typeof(ChestsAwardConfig),
|
| | | typeof(CTGConfig),
|
| | | typeof(DailyTaskConfig),
|
| | | typeof(DamageNumConfig),
|
| | | typeof(DirtyWordConfig),
|
| | | typeof(DungeonConfig),
|
| | | typeof(DungeonOpenTimeConfig),
|
| | | typeof(FaceConfig),
|
| | | typeof(FamilyDonateConfig),
|
| | | typeof(FightPowerRatioConfig),
|
| | | typeof(FirstChargeConfig),
|
| | |
| | | typeof(ItemConfig),
|
| | | typeof(LineupRecommendConfig),
|
| | | typeof(LLMJConfig),
|
| | | typeof(MainChapterConfig),
|
| | | typeof(MainLevelConfig),
|
| | | typeof(ModelConfig),
|
| | | typeof(PlayerLVConfig),
|
| | | typeof(NPCConfig),
|
| | | typeof(NPCExConfig),
|
| | | typeof(NPCLineupConfig),
|
| | | typeof(OrderInfoConfig),
|
| | | typeof(PlayerAttrConfig),
|
| | | typeof(PlayerFaceConfig),
|
| | | typeof(PriorBundleConfig),
|
| | | typeof(RandomNameConfig),
|
| | | typeof(SignInConfig),
|
| | | typeof(StoreConfig),
|
| | | typeof(SuccessConfig),
|
| | | typeof(SysInfoConfig),
|
| | | typeof(TianziConfig),
|
| | | typeof(TitleConfig),
|
| | | typeof(TitleStarUpConfig),
|
| | | typeof(TreasureSetConfig),
|
| | | typeof(TreeLVConfig),
|
| | | typeof(WindowSearchConfig),
|
| | | typeof(XBGetItemConfig),
|
| | | typeof(ZhanlingConfig)
|
| | | };
|
| | |
|
| | |
| | | ClearConfigDictionary<ADAwardConfig>();
|
| | | // 清空 BattleMapConfig 字典
|
| | | ClearConfigDictionary<BattleMapConfig>();
|
| | | // 清空 ChestsAwardConfig 字典
|
| | | ClearConfigDictionary<ChestsAwardConfig>();
|
| | | // 清空 CTGConfig 字典
|
| | | ClearConfigDictionary<CTGConfig>();
|
| | | // 清空 DailyTaskConfig 字典
|
| | | ClearConfigDictionary<DailyTaskConfig>();
|
| | | // 清空 DamageNumConfig 字典
|
| | | ClearConfigDictionary<DamageNumConfig>();
|
| | | // 清空 DirtyWordConfig 字典
|
| | | ClearConfigDictionary<DirtyWordConfig>();
|
| | | // 清空 DungeonConfig 字典
|
| | | ClearConfigDictionary<DungeonConfig>();
|
| | | // 清空 DungeonOpenTimeConfig 字典
|
| | | ClearConfigDictionary<DungeonOpenTimeConfig>();
|
| | | // 清空 FaceConfig 字典
|
| | | ClearConfigDictionary<FaceConfig>();
|
| | | // 清空 FamilyDonateConfig 字典
|
| | | ClearConfigDictionary<FamilyDonateConfig>();
|
| | | // 清空 FightPowerRatioConfig 字典
|
| | |
| | | ClearConfigDictionary<LineupRecommendConfig>();
|
| | | // 清空 LLMJConfig 字典
|
| | | ClearConfigDictionary<LLMJConfig>();
|
| | | // 清空 MainChapterConfig 字典
|
| | | ClearConfigDictionary<MainChapterConfig>();
|
| | | // 清空 MainLevelConfig 字典
|
| | | ClearConfigDictionary<MainLevelConfig>();
|
| | | // 清空 ModelConfig 字典
|
| | | ClearConfigDictionary<ModelConfig>();
|
| | | // 清空 PlayerLVConfig 字典
|
| | | ClearConfigDictionary<PlayerLVConfig>();
|
| | | // 清空 NPCConfig 字典
|
| | | ClearConfigDictionary<NPCConfig>();
|
| | | // 清空 NPCExConfig 字典
|
| | | ClearConfigDictionary<NPCExConfig>();
|
| | | // 清空 NPCLineupConfig 字典
|
| | | ClearConfigDictionary<NPCLineupConfig>();
|
| | | // 清空 OrderInfoConfig 字典
|
| | | ClearConfigDictionary<OrderInfoConfig>();
|
| | | // 清空 PlayerAttrConfig 字典
|
| | | ClearConfigDictionary<PlayerAttrConfig>();
|
| | | // 清空 PlayerFaceConfig 字典
|
| | | ClearConfigDictionary<PlayerFaceConfig>();
|
| | | // 清空 PriorBundleConfig 字典
|
| | | ClearConfigDictionary<PriorBundleConfig>();
|
| | | // 清空 RandomNameConfig 字典
|
| | | ClearConfigDictionary<RandomNameConfig>();
|
| | | // 清空 SignInConfig 字典
|
| | | ClearConfigDictionary<SignInConfig>();
|
| | | // 清空 StoreConfig 字典
|
| | | ClearConfigDictionary<StoreConfig>();
|
| | | // 清空 SuccessConfig 字典
|
| | | ClearConfigDictionary<SuccessConfig>();
|
| | | // 清空 SysInfoConfig 字典
|
| | | ClearConfigDictionary<SysInfoConfig>();
|
| | | // 清空 TianziConfig 字典
|
| | | ClearConfigDictionary<TianziConfig>();
|
| | | // 清空 TitleConfig 字典
|
| | | ClearConfigDictionary<TitleConfig>();
|
| | | // 清空 TitleStarUpConfig 字典
|
| | | ClearConfigDictionary<TitleStarUpConfig>();
|
| | | // 清空 TreasureSetConfig 字典
|
| | | ClearConfigDictionary<TreasureSetConfig>();
|
| | | // 清空 TreeLVConfig 字典
|
| | | ClearConfigDictionary<TreeLVConfig>();
|
| | | // 清空 WindowSearchConfig 字典
|
| | | ClearConfigDictionary<WindowSearchConfig>();
|
| | | // 清空 XBGetItemConfig 字典
|
| | | ClearConfigDictionary<XBGetItemConfig>();
|
| | | // 清空 ZhanlingConfig 字典
|
| | | ClearConfigDictionary<ZhanlingConfig>();
|
| | | }
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: Friday, December 5, 2025
|
| | | // [ Date ]: Tuesday, December 16, 2025
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int[] FetterIDList;
|
| | | public float UIScale;
|
| | | public string Desc;
|
| | | public int RecruitBySelf;
|
| | | public int Specialty;
|
| | | public int HurtType;
|
| | | public int[] Specialty2;
|
| | |
| | |
|
| | | Desc = tables[18];
|
| | |
|
| | | int.TryParse(tables[19],out Specialty); |
| | | int.TryParse(tables[19],out RecruitBySelf); |
| | |
|
| | | int.TryParse(tables[20],out HurtType); |
| | | int.TryParse(tables[20],out Specialty); |
| | |
|
| | | if (tables[21].Contains("[")) |
| | | int.TryParse(tables[21],out HurtType); |
| | |
|
| | | if (tables[22].Contains("[")) |
| | | { |
| | | Specialty2 = JsonMapper.ToObject<int[]>(tables[21]); |
| | | Specialty2 = JsonMapper.ToObject<int[]>(tables[22]); |
| | | } |
| | | else |
| | | { |
| | | string[] Specialty2StringArray = tables[21].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | string[] Specialty2StringArray = tables[22].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | Specialty2 = new int[Specialty2StringArray.Length]; |
| | | for (int i=0;i<Specialty2StringArray.Length;i++) |
| | | { |
| | |
| | | } |
| | | }
|
| | |
|
| | | if (tables[22].Contains("[")) |
| | | if (tables[23].Contains("[")) |
| | | { |
| | | TalentList = JsonMapper.ToObject<int[]>(tables[22]); |
| | | TalentList = JsonMapper.ToObject<int[]>(tables[23]); |
| | | } |
| | | else |
| | | { |
| | | string[] TalentListStringArray = tables[22].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | string[] TalentListStringArray = tables[23].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | TalentList = new int[TalentListStringArray.Length]; |
| | | for (int i=0;i<TalentListStringArray.Length;i++) |
| | | { |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年8月5日
|
| | | // [ Date ]: 2025年12月16日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int LibID;
|
| | | public int ItemID;
|
| | | public int ItemCount;
|
| | | public int WishOutCnt;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | |
| | | int.TryParse(tables[2],out ItemID);
|
| | |
|
| | | int.TryParse(tables[3],out ItemCount);
|
| | |
|
| | | int.TryParse(tables[4],out WishOutCnt); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年9月4日
|
| | | // [ Date ]: 2025年12月16日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public Dictionary<int, int> GridNumMaxLimitInfo;
|
| | | public int AwardMoneyType;
|
| | | public int AwardMoneyValue;
|
| | | public int WishOpen;
|
| | | public Dictionary<int, int> WishLibSelect;
|
| | | public string ProbabilityDisplay;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | |
| | |
|
| | | int.TryParse(tables[14],out AwardMoneyValue);
|
| | |
|
| | | ProbabilityDisplay = tables[15];
|
| | | int.TryParse(tables[15],out WishOpen); |
| | |
|
| | | WishLibSelect = ConfigParse.ParseIntDict(tables[16]); |
| | |
|
| | | ProbabilityDisplay = tables[17];
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | |
| | | public partial class TreasureItemLibConfig : ConfigBase<int, TreasureItemLibConfig> |
| | | { |
| | | private static Dictionary<int, List<int>> resultDict = new Dictionary<int, List<int>>(); |
| | | private static Dictionary<int, List<int>> resultWishIDDict = new Dictionary<int, List<int>>(); |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!resultDict.ContainsKey(LibID)) |
| | |
| | | { |
| | | resultDict[LibID].Add(ItemID); |
| | | } |
| | | |
| | | if (!resultWishIDDict.ContainsKey(LibID)) |
| | | { |
| | | resultWishIDDict[LibID] = new List<int>(); |
| | | } |
| | | if (WishOutCnt > 0) |
| | | { |
| | | resultWishIDDict[LibID].Add(ID); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | return resultDict[libID]; |
| | | } |
| | | |
| | | public static List<int> GetWishIDList(int libID) |
| | | { |
| | | return resultWishIDDict[libID]; |
| | | } |
| | | } |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A5 69 寻宝心愿物品选择 #tagCSTreasureWishSelect
|
| | |
|
| | | public class CA569_tagCSTreasureWishSelect : GameNetPackBasic {
|
| | | public byte TreasureType; //寻宝类型
|
| | | public byte WishCnt;
|
| | | public uint[] WishIDList; // 选择的寻宝物品库中的数据ID,注意不是库ID
|
| | |
|
| | | public CA569_tagCSTreasureWishSelect () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA569;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (TreasureType, NetDataType.BYTE);
|
| | | WriteBytes (WishCnt, NetDataType.BYTE);
|
| | | WriteBytes (WishIDList, NetDataType.DWORD, WishCnt);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6e1a5a03a70ad654a962dc171c579f0b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using LitJson;
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using UnityEngine;
|
| | |
|
| | | //武将相关招募
|
| | | public partial class HappyXBModel : GameSystemManager<HappyXBModel>
|
| | | {
|
| | | public const int XBHeroCallSH_RedKey = 20303; //武将心愿神话 是否选择
|
| | | public const int XBHeroCallCS_RedKey = 20304; //武将心愿传说 是否选择
|
| | | public Redpoint shWishRedpoint = new Redpoint(HappyXB_RedKey, XBHeroCallSH_RedKey);
|
| | | public Redpoint csWishRedpoint = new Redpoint(HappyXB_RedKey, XBHeroCallCS_RedKey);
|
| | |
|
| | | public const int wishMaxOutCnt = 1; //心愿最大出货数量,神话/传说各出一次
|
| | | public int selectWishQuality = 5; //心愿选中的品质
|
| | |
|
| | |
|
| | | public int selectSHHeroWishID = 0; //心愿选中的神话武将心愿ID 客户端
|
| | | public int selectCSHeroWishID = 0; //心愿选中的传说武将心愿ID 客户端
|
| | |
|
| | | public Action OnSelectWishHeroEvent;
|
| | |
|
| | | public int selectWishListTab = 0; //0:神话 1:传说 界面标签选择
|
| | |
|
| | |
|
| | | //心愿选中的武将ID
|
| | | public bool TryGetHeroWishIDByQuality(int type, int quality, out int wishID, out int wishCnt)
|
| | | {
|
| | | wishID = 0;
|
| | | wishCnt = 0;
|
| | | var data = GetXBInfoByType((int)HappXBTitle.HeroCallAdvanced);
|
| | | if (data == null || data.wishCntDict.IsNullOrEmpty())
|
| | | {
|
| | | return false;
|
| | | }
|
| | | foreach (var id in data.wishCntDict.Keys)
|
| | | {
|
| | | if (id == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (HeroConfig.Get(TreasureItemLibConfig.Get(id).ItemID).Quality == quality)
|
| | | {
|
| | | wishID = id;
|
| | | wishCnt = data.wishCntDict[id];
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsTodayWishFinish()
|
| | | {
|
| | | var data = GetXBInfoByType((int)HappXBTitle.HeroCallAdvanced);
|
| | | if (data == null || data.wishCntDict.IsNullOrEmpty())
|
| | | {
|
| | | return false;
|
| | | }
|
| | | int wishCnt = 0;
|
| | | foreach (var id in data.wishCntDict.Keys)
|
| | | {
|
| | | if (id == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | wishCnt += data.wishCntDict[id];
|
| | | }
|
| | | if (wishCnt >= wishMaxOutCnt*2)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | //心愿红点,未分配的需要红点
|
| | | void UpdateWishRedpoint()
|
| | | {
|
| | | shWishRedpoint.state = RedPointState.None;
|
| | | csWishRedpoint.state = RedPointState.None;
|
| | |
|
| | |
|
| | | var data = GetXBInfoByType((int)HappXBTitle.HeroCallAdvanced);
|
| | | if (data == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var config = TreasureSetConfig.Get((int)HappXBTitle.HeroCallAdvanced);
|
| | | var needOpenCnt = config.WishOpen - data.treasureCount;
|
| | | if (needOpenCnt > 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (data.wishCntDict.IsNullOrEmpty())
|
| | | {
|
| | | shWishRedpoint.state = RedPointState.Simple;
|
| | | csWishRedpoint.state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | |
|
| | | int wishID = 0;
|
| | | int wishCnt = 0;
|
| | | if (!TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 5, out wishID, out wishCnt))
|
| | | {
|
| | | shWishRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | |
|
| | | if (!TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 4, out wishID, out wishCnt))
|
| | | {
|
| | | csWishRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b44ecdb2a98211746a0b190bf0c08ae7 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine;
|
| | |
|
| | |
|
| | | public class HappyXBModel : GameSystemManager<HappyXBModel>
|
| | | public partial class HappyXBModel : GameSystemManager<HappyXBModel>
|
| | | {
|
| | | //寻宝产出库
|
| | | private Dictionary<int, Dictionary<int, XBGetItemConfig>> xbGetItemDict = new Dictionary<int, Dictionary<int, XBGetItemConfig>>(); //奖池的所有物品(按类型+等级)
|
| | |
| | | int cnt = info.TreasuerInfoList[i].GridLimitCntList[j].GridCnt;
|
| | | typeInfo.gridLimitCntDict[num] = cnt;
|
| | | }
|
| | | if (typeInfo.wishCntDict == null)
|
| | | {
|
| | | typeInfo.wishCntDict = new Dictionary<int, int>();
|
| | | }
|
| | | typeInfo.wishCntDict.Clear();
|
| | | for (int j = 0; j < info.TreasuerInfoList[i].WishCnt; j++)
|
| | | {
|
| | | int num = info.TreasuerInfoList[i].WishList[j].WishID;
|
| | | int cnt = info.TreasuerInfoList[i].WishList[j].OutCnt;
|
| | | typeInfo.wishCntDict[num] = cnt;
|
| | | }
|
| | |
|
| | | xbTypeInfoDict.Add(info.TreasuerInfoList[i].TreasureType, typeInfo);
|
| | | }
|
| | | else
|
| | |
| | | int num = info.TreasuerInfoList[i].GridLimitCntList[j].GridNum;
|
| | | int cnt = info.TreasuerInfoList[i].GridLimitCntList[j].GridCnt;
|
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].gridLimitCntDict[num] = cnt;
|
| | | }
|
| | | |
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].wishCntDict.Clear();
|
| | | for (int j = 0; j < info.TreasuerInfoList[i].WishCnt; j++)
|
| | | {
|
| | | int num = info.TreasuerInfoList[i].WishList[j].WishID;
|
| | | int cnt = info.TreasuerInfoList[i].WishList[j].OutCnt;
|
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].wishCntDict[num] = cnt;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Hero))
|
| | | return;
|
| | |
|
| | | UpdateWishRedpoint();
|
| | |
|
| | | // 免费 10连 积分
|
| | | bestXB10Red.state = RedPointState.None;
|
| | | bestXBFreeRed.state = RedPointState.None;
|
| | |
| | | public int treasureCountToday; //今日已寻宝总次数
|
| | | public int treasureCntAward; //累计寻宝次数对应奖励领奖状态,按奖励记录索引二进制记录是否已领取
|
| | | public Dictionary<int, int> gridLimitCntDict; //<有限制抽取次数的格子编号,已抽到次数> 有限制抽取次数的格子次数信息
|
| | | public Dictionary<int, int> wishCntDict; //心愿抽取情况 <心愿ID,已抽到次数>
|
| | | }
|
| | |
|
| | |
|
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.Events; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class HeroCallHopeAddCell : MonoBehaviour |
| | | { |
| | | [SerializeField] HeroHeadBaseNoTrainCell head; |
| | | [SerializeField] Image notOpenImg; |
| | | [SerializeField] Image addImg; |
| | | [SerializeField] Button addBtn; |
| | | |
| | | |
| | | |
| | | public void Display(int quality, UnityAction<int> addAction = null, UnityAction<int> heroAction = null, int changeHeroID = 0) |
| | | { |
| | | var data = HappyXBModel.Instance.GetXBInfoByType((int)HappXBTitle.HeroCallAdvanced); |
| | | var config = TreasureSetConfig.Get((int)HappXBTitle.HeroCallAdvanced); |
| | | var needOpenCnt = config.WishOpen - data.treasureCount; |
| | | |
| | | |
| | | int wishID = 0; |
| | | int wishCnt = 0; |
| | | int heroID = 0; |
| | | if (needOpenCnt <= 0) |
| | | { |
| | | notOpenImg.SetActive(false); |
| | | |
| | | |
| | | if (HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, quality, out wishID, out wishCnt)) |
| | | { |
| | | if (heroAction == null) |
| | | { |
| | | heroAction = (quality) => |
| | | { |
| | | if (HappyXBModel.Instance.IsTodayWishFinish()) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroWishFinish"); |
| | | return; |
| | | } |
| | | |
| | | UIManager.Instance.OpenWindow<HeroCallHopeWin>(quality == 4 ? 1 : 0); |
| | | }; |
| | | } |
| | | |
| | | heroID = TreasureItemLibConfig.Get(wishID).ItemID; |
| | | |
| | | } |
| | | if (changeHeroID > 0) |
| | | { |
| | | //预览 |
| | | heroID = changeHeroID; |
| | | } |
| | | if (heroID > 0) |
| | | { |
| | | head.SetActive(true); |
| | | addImg.SetActive(false); |
| | | head.Init(heroID, wishCnt >= HappyXBModel.wishMaxOutCnt, ()=> { heroAction.Invoke(quality); }); |
| | | } |
| | | else |
| | | { |
| | | head.SetActive(false); |
| | | addImg.SetActive(true); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | notOpenImg.SetActive(true); |
| | | addImg.SetActive(false); |
| | | head.SetActive(false); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | if (addAction == null) |
| | | { |
| | | addBtn.AddListener(() => |
| | | { |
| | | if (needOpenCnt <= 0) |
| | | { |
| | | if (HappyXBModel.Instance.IsTodayWishFinish()) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroWishFinish"); |
| | | return; |
| | | } |
| | | UIManager.Instance.OpenWindow<HeroCallHopeWin>(quality == 4 ? 1 : 0); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroWishCallOpen", needOpenCnt); |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | addBtn.AddListener(()=> { addAction.Invoke(quality); }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 03f46fdaedeebd148921ae2997a40299 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.Events; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class HeroCallHopeLineCell : CellView |
| | | { |
| | | [SerializeField] HeroCallHopeSelectCell[] heads; |
| | | |
| | | |
| | | |
| | | public void Display(int libID, int index) |
| | | { |
| | | var list = TreasureItemLibConfig.GetWishIDList(libID); |
| | | if (list == null || list.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | for (int i = 0; i < heads.Length; i++) |
| | | { |
| | | if (index + i < list.Count) |
| | | { |
| | | heads[i].SetActive(true); |
| | | heads[i].Display(list[index + i]); |
| | | } |
| | | else |
| | | { |
| | | heads[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e75e54662e5a2ce41ab610f286b3638f |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.Events; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class HeroCallHopeSelectCell : MonoBehaviour |
| | | { |
| | | [SerializeField] HeroHeadBaseNoTrainCell head; |
| | | [SerializeField] Image selectImg; |
| | | [SerializeField] Transform lockImg; |
| | | |
| | | |
| | | |
| | | public void Display(int wishID) |
| | | { |
| | | var config = TreasureItemLibConfig.Get(wishID); |
| | | if (config == null) |
| | | { |
| | | return; |
| | | } |
| | | head.SetActive(true); |
| | | bool isActive = true; |
| | | if (HeroConfig.Get(config.ItemID).RecruitBySelf == 1 && HeroUIManager.Instance.GetHeroBookState(config.ItemID, 0) == 0) |
| | | { |
| | | isActive = false; |
| | | } |
| | | lockImg.SetActive(!isActive); |
| | | |
| | | var selectID = HappyXBModel.Instance.selectWishListTab == 0 ? HappyXBModel.Instance.selectSHHeroWishID : HappyXBModel.Instance.selectCSHeroWishID; |
| | | selectImg.SetActive(config.ID == selectID); |
| | | |
| | | head.Init(config.ItemID, false, ()=> |
| | | { |
| | | if (!isActive) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroWishUnLock"); |
| | | return; |
| | | } |
| | | int quality = HappyXBModel.Instance.selectWishListTab == 0 ? 5 : 4; |
| | | if (HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, quality, out int _wishID, out int _wishCnt)) |
| | | { |
| | | if (_wishCnt >= HappyXBModel.wishMaxOutCnt) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroWishFinish"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if (HappyXBModel.Instance.selectWishListTab == 0) |
| | | { |
| | | HappyXBModel.Instance.selectSHHeroWishID = wishID; |
| | | } |
| | | else |
| | | { |
| | | HappyXBModel.Instance.selectCSHeroWishID = wishID; |
| | | } |
| | | HappyXBModel.Instance.OnSelectWishHeroEvent?.Invoke(); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: de3fbdcb1649eef4389f255bdbf6a1c5 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 招募心愿 |
| | | /// </summary> |
| | | public class HeroCallHopeWin : UIBase |
| | | { |
| | | [SerializeField] HeroCallHopeAddCell shHero; |
| | | [SerializeField] HeroCallHopeAddCell csHero; |
| | | [SerializeField] Text tip; |
| | | [SerializeField] ScrollerController scroller; |
| | | [SerializeField] GroupButtonEx shBtn; |
| | | [SerializeField] GroupButtonEx csBtn; |
| | | [SerializeField] Button cancleBtn; |
| | | [SerializeField] Button confirmBtn; |
| | | |
| | | |
| | | |
| | | Dictionary<int, int> qualityLibIDDict = new Dictionary<int, int>() |
| | | { |
| | | { 0, 105 }, |
| | | { 1, 104 } |
| | | }; |
| | | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | cancleBtn.AddListener(CloseWindow); |
| | | confirmBtn.AddListener(SendSelectHero); |
| | | shBtn.AddListener(()=> |
| | | { |
| | | HappyXBModel.Instance.selectWishListTab = 0; |
| | | Display(); |
| | | }); |
| | | csBtn.AddListener(()=> |
| | | { |
| | | HappyXBModel.Instance.selectWishListTab = 1; |
| | | Display(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | HappyXBModel.Instance.selectWishListTab = functionOrder; |
| | | HappyXBModel.Instance.RefreshXBTypeInfoAct += RefreshXBTypeInfo; |
| | | HappyXBModel.Instance.OnSelectWishHeroEvent += OnSelectWishHeroEvent; |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 5, out HappyXBModel.Instance.selectSHHeroWishID, out int shWishCnt); |
| | | HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 4, out HappyXBModel.Instance.selectCSHeroWishID, out int csWishCnt); |
| | | |
| | | tip.text = Language.Get("HeroCall7", HappyXBModel.wishMaxOutCnt); |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | HappyXBModel.Instance.RefreshXBTypeInfoAct -= RefreshXBTypeInfo; |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | HappyXBModel.Instance.OnSelectWishHeroEvent -= OnSelectWishHeroEvent; |
| | | } |
| | | |
| | | void Display() |
| | | { |
| | | shHero.Display(5, AddHero, ShowHeroTip, HappyXBModel.Instance.selectSHHeroWishID == 0 ? 0 : TreasureItemLibConfig.Get(HappyXBModel.Instance.selectSHHeroWishID).ItemID); |
| | | csHero.Display(4, AddHero, ShowHeroTip, HappyXBModel.Instance.selectCSHeroWishID == 0 ? 0 : TreasureItemLibConfig.Get(HappyXBModel.Instance.selectCSHeroWishID).ItemID); |
| | | |
| | | CreateScroller(); |
| | | |
| | | if (HappyXBModel.Instance.selectWishListTab == 0) |
| | | { |
| | | shBtn.SelectBtn(); |
| | | } |
| | | else |
| | | { |
| | | csBtn.SelectBtn(); |
| | | } |
| | | } |
| | | |
| | | |
| | | void CreateScroller() |
| | | { |
| | | int libID = qualityLibIDDict[HappyXBModel.Instance.selectWishListTab]; |
| | | if (!TreasureSetConfig.Get((int)HappXBTitle.HeroCallAdvanced).WishLibSelect.ContainsKey(libID)) |
| | | { |
| | | Debug.LogError("寻宝库ID变更,程序请核对qualityLibIDDict"); |
| | | return; |
| | | } |
| | | scroller.Refresh(); |
| | | var list = TreasureItemLibConfig.GetWishIDList(libID); |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | if (i % 5 == 0) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | scroller.Restart(); |
| | | } |
| | | |
| | | |
| | | |
| | | void AddHero(int quality) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroWishAdd"); |
| | | HappyXBModel.Instance.selectWishListTab = quality == 4 ? 1 : 0; |
| | | |
| | | Display(); |
| | | } |
| | | |
| | | void ShowHeroTip(int quality) |
| | | { |
| | | ItemTipUtility.Show(quality == 4 ? TreasureItemLibConfig.Get(HappyXBModel.Instance.selectCSHeroWishID).ItemID : |
| | | TreasureItemLibConfig.Get(HappyXBModel.Instance.selectSHHeroWishID).ItemID); |
| | | } |
| | | |
| | | void RefreshXBTypeInfo() |
| | | { |
| | | HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 5, out HappyXBModel.Instance.selectSHHeroWishID, out int shWishCnt); |
| | | HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 4, out HappyXBModel.Instance.selectCSHeroWishID, out int csWishCnt); |
| | | Display(); |
| | | } |
| | | |
| | | void OnSelectWishHeroEvent() |
| | | { |
| | | shHero.Display(5, AddHero, ShowHeroTip, HappyXBModel.Instance.selectSHHeroWishID == 0 ? 0 : TreasureItemLibConfig.Get(HappyXBModel.Instance.selectSHHeroWishID).ItemID); |
| | | csHero.Display(4, AddHero, ShowHeroTip, HappyXBModel.Instance.selectCSHeroWishID == 0 ? 0 : TreasureItemLibConfig.Get(HappyXBModel.Instance.selectCSHeroWishID).ItemID); |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | |
| | | void SendSelectHero() |
| | | { |
| | | if (HappyXBModel.Instance.selectSHHeroWishID == 0 && HappyXBModel.Instance.selectCSHeroWishID == 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroWishAdd"); |
| | | return; |
| | | } |
| | | var pack = new CA569_tagCSTreasureWishSelect(); |
| | | pack.TreasureType = (int)HappXBTitle.HeroCallAdvanced; |
| | | |
| | | pack.WishIDList = new uint[] { (uint)HappyXBModel.Instance.selectSHHeroWishID, (uint)HappyXBModel.Instance.selectCSHeroWishID }; |
| | | pack.WishCnt = 2; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | CloseWindow(); |
| | | } |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<HeroCallHopeLineCell>(); |
| | | _cell.Display(qualityLibIDDict[HappyXBModel.Instance.selectWishListTab], cell.index); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 171ff86eed580f34fa0215bd6f14648d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | [SerializeField] Button closeBtn; |
| | | [SerializeField] Text callTip; |
| | | |
| | | //心愿 |
| | | [SerializeField] Text openXYTip; |
| | | [SerializeField] HeroCallHopeAddCell shHero; |
| | | [SerializeField] HeroCallHopeAddCell csHero; |
| | | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | |
| | | qualityStrList.Add(UIHelper.AppendColor(qualityList[i], Language.Get("L1039", Language.Get("CommonQuality" + qualityList[i])))); |
| | | } |
| | | callTip.text = Language.Get("HeroCall6", needCount, string.Join(Language.Get("L1130"), qualityStrList.ToArray())); |
| | | ShowWish(); |
| | | } |
| | | |
| | | //每秒刷新免费CD的倒计时 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | void ShowWish() |
| | | { |
| | | var data = HappyXBModel.Instance.GetXBInfoByType((int)HappXBTitle.HeroCallAdvanced); |
| | | var config = TreasureSetConfig.Get((int)HappXBTitle.HeroCallAdvanced); |
| | | var needOpenCnt = config.WishOpen - data.treasureCount; |
| | | |
| | | openXYTip.SetActive(needOpenCnt > 0); |
| | | openXYTip.text = Language.Get("HeroCall10", needOpenCnt); |
| | | shHero.Display(5); |
| | | csHero.Display(4); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using UnityEngine.Events; |
| | | using System.Collections.Generic; |
| | | |
| | | public class HeroHeadBaseNoTrainCell : MonoBehaviour |
| | | { |
| | | |
| | | Button m_ClickBtn; |
| | | Button clickBtn |
| | | { |
| | | get |
| | | { |
| | | if (m_ClickBtn == null) |
| | | { |
| | | m_ClickBtn = this.transform.GetComponent<Button>("Container_HeadCell"); |
| | | } |
| | | return m_ClickBtn; |
| | | } |
| | | } |
| | | |
| | | Image m_QualityBG; |
| | | Image qualityBG |
| | | { |
| | | get |
| | | { |
| | | if (m_QualityBG == null) |
| | | { |
| | | m_QualityBG = this.transform.GetComponent<Image>("Container_HeadCell/qualityIcon"); |
| | | } |
| | | return m_QualityBG; |
| | | } |
| | | } |
| | | |
| | | ImageEx m_HeroIcon; |
| | | ImageEx heroIcon |
| | | { |
| | | get |
| | | { |
| | | if (m_HeroIcon == null) |
| | | { |
| | | m_HeroIcon = this.transform.GetComponent<ImageEx>("Container_HeadCell/heroIcon"); |
| | | } |
| | | return m_HeroIcon; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | Image m_CountryImg; |
| | | Image countryImg |
| | | { |
| | | get |
| | | { |
| | | if (m_CountryImg == null) |
| | | { |
| | | m_CountryImg = this.transform.GetComponent<Image>("Container_HeadCell/country"); |
| | | } |
| | | return m_CountryImg; |
| | | } |
| | | } |
| | | |
| | | Image m_JobImg; |
| | | Image jobImg |
| | | { |
| | | get |
| | | { |
| | | if (m_JobImg == null) |
| | | { |
| | | m_JobImg = this.transform.GetComponent<Image>("Container_HeadCell/name/job"); |
| | | } |
| | | return m_JobImg; |
| | | } |
| | | } |
| | | |
| | | Text m_NameText; |
| | | Text nameText |
| | | { |
| | | get |
| | | { |
| | | if (m_NameText == null) |
| | | { |
| | | m_NameText = this.transform.GetComponent<Text>("Container_HeadCell/name"); |
| | | } |
| | | return m_NameText; |
| | | } |
| | | } |
| | | |
| | | void Awake() |
| | | { |
| | | LoadPrefab(); |
| | | } |
| | | |
| | | // 武将小头像,(职业和名称不再此管理,各个界面排版不同) |
| | | public void Init(int heroID, bool _gray = false, UnityAction onclick = null) |
| | | { |
| | | LoadPrefab(); //存在被卸载的可能,重新加载 |
| | | clickBtn.AddListener(onclick); |
| | | var heroConfig = HeroConfig.Get(heroID); |
| | | qualityBG.SetSprite("heroheadBG" + heroConfig.Quality); |
| | | |
| | | var sprite = UILoader.LoadSprite("HeroHead", HeroSkinConfig.Get(heroConfig.SkinIDList[0]).SquareIcon); |
| | | heroIcon.overrideSprite = sprite; |
| | | heroIcon.gray = _gray; |
| | | |
| | | countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country)); |
| | | jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class)); |
| | | nameText.text = heroConfig.Name; |
| | | |
| | | |
| | | } |
| | | |
| | | GameObject cellContainer; |
| | | protected void LoadPrefab() |
| | | { |
| | | if (cellContainer != null) |
| | | return; |
| | | |
| | | var tmp = transform.Find("Container_HeadCell"); |
| | | if (tmp != null) |
| | | { |
| | | cellContainer = tmp.gameObject; |
| | | return; |
| | | } |
| | | if (cellContainer == null) |
| | | { |
| | | cellContainer = UIUtility.CreateWidget("HeroHeadBaseNoTrainCell", "Container_HeadCell"); |
| | | |
| | | if (cellContainer != null) |
| | | { |
| | | cellContainer.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one); |
| | | cellContainer.transform.SetAsFirstSibling(); |
| | | } |
| | | } |
| | | |
| | | //缩放到和父rect一样大 |
| | | var scale = 1f; |
| | | var rect = cellContainer.GetComponent<RectTransform>(); |
| | | var parentRect = transform.GetComponent<RectTransform>(); |
| | | float width = parentRect.sizeDelta.x; |
| | | if (width <= 0f) |
| | | { |
| | | //外部控制了尺寸获取为0 |
| | | GridLayoutGroup grid = GetComponentInParent<GridLayoutGroup>(); |
| | | if (grid != null) |
| | | { |
| | | width = grid.cellSize.x; |
| | | } |
| | | |
| | | } |
| | | scale = width / rect.sizeDelta.x; |
| | | cellContainer.transform.localScale = cellContainer.transform.localScale * scale; |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d35032963a8cb6248ace536aff906122 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |