| | |
| | |
|
| | | // 加载配置文件
|
| | | HashSet<Type> configTypes = new HashSet<Type>() {
|
| | | typeof(ChatBubbleBoxConfig),
|
| | | typeof(CTGConfig),
|
| | | typeof(DailyLivenessRewardConfig),
|
| | | typeof(DailyQuestConfig),
|
| | | typeof(DailyQuestOpenTimeConfig),
|
| | | typeof(DienstgradConfig),
|
| | | typeof(DirtyNameConfig),
|
| | | typeof(DirtyWordConfig),
|
| | | typeof(EffectConfig),
|
| | | typeof(EquipGSParamConfig),
|
| | | typeof(TitleStarUpConfig)
|
| | | typeof(EquipPlaceMapConfig),
|
| | | typeof(FamilyEmblemConfig),
|
| | | typeof(FrameAnimationConfig),
|
| | | typeof(FuncConfigConfig),
|
| | | typeof(FuncOpenLVConfig),
|
| | | typeof(FunctionTeamSetConfig),
|
| | | typeof(GetItemWaysConfig),
|
| | | typeof(GmCmdConfig),
|
| | | typeof(HeroAwakeConfig),
|
| | | typeof(HeroConfig),
|
| | | typeof(HeroQualityAwakeConfig),
|
| | | typeof(HeroQualityBreakConfig),
|
| | | typeof(HeroQualityConfig),
|
| | | typeof(HeroSkinConfig),
|
| | | typeof(ItemConfig),
|
| | | typeof(KickOutReasonConfig),
|
| | | typeof(MainChapterConfig),
|
| | | typeof(MainLevelConfig),
|
| | | typeof(NPCConfig),
|
| | | typeof(NPCLineupConfig),
|
| | | typeof(OrderInfoConfig),
|
| | | typeof(PlayerFaceConfig),
|
| | | typeof(PlayerLVConfig),
|
| | | typeof(PlayerPropertyConfig),
|
| | | typeof(priorbundleConfig),
|
| | | typeof(RealmConfig),
|
| | | typeof(RealmLVUPTaskConfig),
|
| | | typeof(RuleConfig),
|
| | | typeof(SkillConfig),
|
| | | typeof(TaskConfig),
|
| | | typeof(TitleStarUpConfig),
|
| | | typeof(TreasureCntAwardConfig),
|
| | | typeof(TreasureItemLibConfig),
|
| | | typeof(TreasureSetConfig),
|
| | | typeof(TreeLVConfig),
|
| | | typeof(XBGetItemConfig)
|
| | | };
|
| | |
|
| | | #if UNITY_EDITOR
|
| | |
| | |
|
| | | public override void Release()
|
| | | {
|
| | | // 清空 ChatBubbleBoxConfig 字典
|
| | | ClearConfigDictionary<ChatBubbleBoxConfig>();
|
| | | // 清空 CTGConfig 字典
|
| | | ClearConfigDictionary<CTGConfig>();
|
| | | // 清空 DailyLivenessRewardConfig 字典
|
| | | ClearConfigDictionary<DailyLivenessRewardConfig>();
|
| | | // 清空 DailyQuestConfig 字典
|
| | | ClearConfigDictionary<DailyQuestConfig>();
|
| | | // 清空 DailyQuestOpenTimeConfig 字典
|
| | | ClearConfigDictionary<DailyQuestOpenTimeConfig>();
|
| | | // 清空 DienstgradConfig 字典
|
| | | ClearConfigDictionary<DienstgradConfig>();
|
| | | // 清空 DirtyNameConfig 字典
|
| | | ClearConfigDictionary<DirtyNameConfig>();
|
| | | // 清空 DirtyWordConfig 字典
|
| | | ClearConfigDictionary<DirtyWordConfig>();
|
| | | // 清空 EffectConfig 字典
|
| | | ClearConfigDictionary<EffectConfig>();
|
| | | // 清空 EquipGSParamConfig 字典
|
| | | ClearConfigDictionary<EquipGSParamConfig>();
|
| | | // 清空 EquipPlaceMapConfig 字典
|
| | | ClearConfigDictionary<EquipPlaceMapConfig>();
|
| | | // 清空 FamilyEmblemConfig 字典
|
| | | ClearConfigDictionary<FamilyEmblemConfig>();
|
| | | // 清空 FrameAnimationConfig 字典
|
| | | ClearConfigDictionary<FrameAnimationConfig>();
|
| | | // 清空 FuncConfigConfig 字典
|
| | | ClearConfigDictionary<FuncConfigConfig>();
|
| | | // 清空 FuncOpenLVConfig 字典
|
| | | ClearConfigDictionary<FuncOpenLVConfig>();
|
| | | // 清空 FunctionTeamSetConfig 字典
|
| | | ClearConfigDictionary<FunctionTeamSetConfig>();
|
| | | // 清空 GetItemWaysConfig 字典
|
| | | ClearConfigDictionary<GetItemWaysConfig>();
|
| | | // 清空 GmCmdConfig 字典
|
| | | ClearConfigDictionary<GmCmdConfig>();
|
| | | // 清空 HeroAwakeConfig 字典
|
| | | ClearConfigDictionary<HeroAwakeConfig>();
|
| | | // 清空 HeroConfig 字典
|
| | | ClearConfigDictionary<HeroConfig>();
|
| | | // 清空 HeroQualityAwakeConfig 字典
|
| | | ClearConfigDictionary<HeroQualityAwakeConfig>();
|
| | | // 清空 HeroQualityBreakConfig 字典
|
| | | ClearConfigDictionary<HeroQualityBreakConfig>();
|
| | | // 清空 HeroQualityConfig 字典
|
| | | ClearConfigDictionary<HeroQualityConfig>();
|
| | | // 清空 HeroSkinConfig 字典
|
| | | ClearConfigDictionary<HeroSkinConfig>();
|
| | | // 清空 ItemConfig 字典
|
| | | ClearConfigDictionary<ItemConfig>();
|
| | | // 清空 KickOutReasonConfig 字典
|
| | | ClearConfigDictionary<KickOutReasonConfig>();
|
| | | // 清空 MainChapterConfig 字典
|
| | | ClearConfigDictionary<MainChapterConfig>();
|
| | | // 清空 MainLevelConfig 字典
|
| | | ClearConfigDictionary<MainLevelConfig>();
|
| | | // 清空 NPCConfig 字典
|
| | | ClearConfigDictionary<NPCConfig>();
|
| | | // 清空 NPCLineupConfig 字典
|
| | | ClearConfigDictionary<NPCLineupConfig>();
|
| | | // 清空 OrderInfoConfig 字典
|
| | | ClearConfigDictionary<OrderInfoConfig>();
|
| | | // 清空 PlayerFaceConfig 字典
|
| | | ClearConfigDictionary<PlayerFaceConfig>();
|
| | | // 清空 PlayerLVConfig 字典
|
| | | ClearConfigDictionary<PlayerLVConfig>();
|
| | | // 清空 PlayerPropertyConfig 字典
|
| | | ClearConfigDictionary<PlayerPropertyConfig>();
|
| | | // 清空 priorbundleConfig 字典
|
| | | ClearConfigDictionary<priorbundleConfig>();
|
| | | // 清空 RealmConfig 字典
|
| | | ClearConfigDictionary<RealmConfig>();
|
| | | // 清空 RealmLVUPTaskConfig 字典
|
| | | ClearConfigDictionary<RealmLVUPTaskConfig>();
|
| | | // 清空 RuleConfig 字典
|
| | | ClearConfigDictionary<RuleConfig>();
|
| | | // 清空 SkillConfig 字典
|
| | | ClearConfigDictionary<SkillConfig>();
|
| | | // 清空 TaskConfig 字典
|
| | | ClearConfigDictionary<TaskConfig>();
|
| | | // 清空 TitleStarUpConfig 字典
|
| | | ClearConfigDictionary<TitleStarUpConfig>();
|
| | | // 清空 TreasureCntAwardConfig 字典
|
| | | ClearConfigDictionary<TreasureCntAwardConfig>();
|
| | | // 清空 TreasureItemLibConfig 字典
|
| | | ClearConfigDictionary<TreasureItemLibConfig>();
|
| | | // 清空 TreasureSetConfig 字典
|
| | | ClearConfigDictionary<TreasureSetConfig>();
|
| | | // 清空 TreeLVConfig 字典
|
| | | ClearConfigDictionary<TreeLVConfig>();
|
| | | // 清空 XBGetItemConfig 字典
|
| | | ClearConfigDictionary<XBGetItemConfig>();
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | |
| | | private static Dictionary<int, List<PlayerPropertyConfig>> m_PropCfgs = new Dictionary<int, List<PlayerPropertyConfig>>(); |
| | | private static Dictionary<int, List<int>> outputDict = new Dictionary<int, List<int>>(); |
| | | |
| | | public static int[] baseAttrs = { 6, 7, 8 }; //攻防血 |
| | | |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | List<PlayerPropertyConfig> list = null; |
| | |
| | | managers.Add(OfficialRankManager.Instance);
|
| | | managers.Add(RankModel.Instance);
|
| | | managers.Add(PlayerMainDate.Instance);
|
| | | managers.Add(HeroUIManager.Instance);
|
| | |
|
| | | foreach (var manager in managers)
|
| | | {
|
| | |
| | | {
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= RefreshStoreScore;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= UpdateFuncState;
|
| | | PackManager.Instance.refreshItemCountEvent -= RefreshXBTool;
|
| | | PackManager.Instance.RefreshItemEvent -= RefreshXBTool;
|
| | | isXBCoolTime = false;
|
| | | XBNotifyParms.Clear();
|
| | | xbTypeInfoDict.Clear();
|
| | |
| | | USETOOLXBKey = StringUtility.Contact(playerId, "UseToolXB");
|
| | | XBWarehouseRedPoint();
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += RefreshStoreScore;
|
| | | PackManager.Instance.refreshItemCountEvent += RefreshXBTool;
|
| | | PackManager.Instance.RefreshItemEvent += RefreshXBTool;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += UpdateFuncState;
|
| | | }
|
| | |
|
| | |
| | | //计算个人/职业/种族养成属性加成 |
| | | public void CalculateProperties() |
| | | { |
| | | // 武将单体属性,根据继承比例,从全体属性继承得到 |
| | | // 例如:武将攻击力= |
| | | // [(装备基础固定值+其它模块的固定值)* (1+初始加成%+武将升级加成%+武将突破加成%+武将吞噬星级加成%+图鉴加成%)] |
| | | // * |
| | | // [ 继承比例*(1+羁绊加成%+潜能加成%+天赋加成%+觉醒效果加成%)] |
| | | // 武将单体属性,根据继承比例,从全体属性继承得到 |
| | | // 例如:武将攻击力= |
| | | // [(装备基础固定值+其它模块的固定值)* (1+初始加成%+武将升级加成%+武将突破加成%+武将吞噬星级加成%+图鉴加成%)] |
| | | // * |
| | | // [ 继承比例*(1+羁绊加成%+潜能加成%+天赋加成%+觉醒效果加成%)] |
| | | hp = GetProperties(HeroAttrType.hp); |
| | | attack = GetProperties(HeroAttrType.attack); |
| | | defense = GetProperties(HeroAttrType.defense); |
| | |
| | | |
| | | protected int GetProperties(HeroAttrType attrType) |
| | | { |
| | | return GetStableProperties(attrType) |
| | | return GetStableProperties(attrType) |
| | | * GetCultivationPercent(attrType) |
| | | * GetInheritRate(attrType) |
| | | * GetInheritRate(attrType) |
| | | * GetInfluenceByInheritPercent(attrType); |
| | | } |
| | | |
| | |
| | | counterAttackResist + |
| | | recoverResist; |
| | | } |
| | | |
| | | |
| | | //上阵属性:攻防血 |
| | | public int GetGoBattleAddPer() |
| | | { |
| | | return qualityConfig.InitAddPer + qualityConfig.LVAddPer * heroLevel + qualityConfig.BreakLVAddPer * breakLevel + qualityConfig.StarAddPer * heroStar; |
| | | } |
| | | } |
| | |
| | | { |
| | | base.Init(); |
| | | |
| | | PackManager.Instance.refrechPackEvent += refrechPackEvent; |
| | | PackManager.Instance.ChangeItemEvent += ChangeHero; |
| | | PackManager.Instance.DeleteItemEvent += DeleteHero; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize; |
| | |
| | | public override void Release() |
| | | { |
| | | base.Release(); |
| | | PackManager.Instance.refrechPackEvent -= refrechPackEvent; |
| | | PackManager.Instance.ChangeItemEvent -= ChangeHero; |
| | | PackManager.Instance.DeleteItemEvent -= DeleteHero; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize; |
| | |
| | | heroInfoDict.Clear(); |
| | | } |
| | | |
| | | void refrechPackEvent(PackType packType) |
| | | { |
| | | if (packType == PackType.Hero) |
| | | { |
| | | InitHerosInfo(); |
| | | } |
| | | } |
| | | |
| | | // isCreate bool:true代表创建 false 刷新触发 |
| | | void ChangeHero(PackType packType, string guid, bool isCreate) |
| | |
| | | public List<HeroInfo> GetHeroList() |
| | | { |
| | | return heroInfoDict.Values.ToList(); |
| | | } |
| | | |
| | | |
| | | void InitHerosInfo() |
| | | { |
| | | heroInfoDict.Clear(); |
| | | SinglePack heroPack = PackManager.Instance.GetSinglePack(PackType.Hero); |
| | | Dictionary<int, ItemModel> heroes = heroPack.GetAllItems(); |
| | | |
| | | foreach (ItemModel hero in heroes.Values) |
| | | { |
| | | ChangeHero(hero.packType, hero.guid, true); |
| | | } |
| | | } |
| | | |
| | | public List<HeroInfo> GetPowerfulHeroList() |
| | |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 武将列表 |
| | | /// 武将基础界面 |
| | | /// </summary> |
| | | public class HeroBaseWin : FunctionsBaseWin |
| | | { |
| | | |
| | | [SerializeField] List<Image> funcSelectImgList; |
| | | [SerializeField] List<Image> funcUnSelectImgList; |
| | | [SerializeField] List<Text> titleNameList; |
| | | |
| | | /// </summary> |
| | | protected override void InitComponent() |
| | |
| | | { |
| | | funcSelectImgList[i].SetActive(true); |
| | | funcUnSelectImgList[i].SetActive(false); |
| | | titleNameList[i].color = UIHelper.GetUIColor(TextColType.titleSelectColor); |
| | | |
| | | } |
| | | else |
| | | { |
| | | funcSelectImgList[i].SetActive(false); |
| | | funcUnSelectImgList[i].SetActive(true); |
| | | titleNameList[i].color = UIHelper.GetUIColor(TextColType.titleUnSelectColor); |
| | | |
| | | } |
| | | } |
| | |
| | | switch (functionOrder) |
| | | { |
| | | case 0: |
| | | // 打开主页界面 |
| | | currentSubUI = UIManager.Instance.OpenWindow<HeroListWin>(); |
| | | break; |
| | | |
| | | case 1: |
| | | //currentSubUI = UIManager.Instance.OpenWindow<HeroCollectionsWin>(); |
| | | break; |
| | | default: |
| | | Debug.LogWarning("未知的标签索引: " + functionOrder); |
| | | break; |
| | |
| | | /// </summary> |
| | | protected override void InitComponent() |
| | | { |
| | | |
| | | heroPackBtn.onClick.AddListener(() => |
| | | { |
| | | HeroUIManager.Instance.QueryUnLockHeroPack(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | heroListScroller.OnRefreshCell += OnRefreshCell; |
| | | PackManager.Instance.RefreshItemEvent += RefreshPakCount; |
| | | HeroManager.Instance.SortHeroList(); |
| | | CreateScroller(); |
| | | Refresh(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | heroListScroller.OnRefreshCell -= OnRefreshCell; |
| | | PackManager.Instance.RefreshItemEvent -= RefreshPakCount; |
| | | } |
| | | |
| | | |
| | | public override void Refresh() |
| | | { |
| | | SinglePack singlePack = PackManager.Instance.GetSinglePack(PackType.Item); |
| | | if (singlePack == null || singlePack.GetAllItems().Count <= 0) |
| | | { |
| | | heroListEmpty.SetActive(true); |
| | | heroListScroller.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | heroListEmpty.SetActive(false); |
| | | heroListScroller.SetActive(true); |
| | | } |
| | | |
| | | //上阵属性 |
| | | for (int i = 0; i < attrOnList.Count; i++) |
| | | { |
| | | attrOnList[i].text = PlayerPropertyConfig.GetFullDescription(new Int2 (PlayerPropertyConfig.baseAttrs[i], 1 )); |
| | | } |
| | | } |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | |
| | | for (int i = 0; i < HeroManager.Instance.heroSortList.Count; i++) |
| | | { |
| | | if (i % 4 == 0) |
| | | { |
| | | { |
| | | heroListScroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | heroListScroller.Restart(); |
| | | } |
| | | |
| | | void RefreshPakCount(PackType type, int index, int itemID) |
| | | { |
| | | SinglePack singlePack = PackManager.Instance.GetSinglePack(PackType.Item); |
| | | if (singlePack == null) |
| | | return; |
| | | |
| | | int count = singlePack.GetAllItems().Count; |
| | | |
| | | heroPackText.text = UIHelper.AppendColor(count > singlePack.unlockedGridCount ? TextColType.Red : TextColType.NavyBrown, |
| | | string.Format("{0}/{1}", count, singlePack.unlockedGridCount)); |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | using UnityEngine; |
| | | |
| | | public class HeroUIManager : GameSystemManager<HeroUIManager> |
| | | { |
| | | |
| | | |
| | | public void OnBeforePlayerDataInitialize() |
| | | { |
| | | |
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | } |
| | | |
| | | public override void Init() |
| | | { |
| | | |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | |
| | | } |
| | | |
| | | void ParseConfig() |
| | | { |
| | | } |
| | | |
| | | |
| | | public void QueryUnLockHeroPack() |
| | | { |
| | | //解锁更多的武将背包 |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9fea3ff7a48170a49bf7449f19ccea8e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | // }
|
| | | }
|
| | |
|
| | | public event Action<PackType, string> PickItemEvent; //捡起的物品
|
| | |
|
| | | //用于过滤道具飘入表现 在不想出现物品飘动的界面 开启界面的时候设置true ,关闭界面设置false
|
| | | public bool hidePickItem = false;
|
| | | public void RefreshPickItem(PackType type, string itemIDStr)
|
| | | {
|
| | | if (hidePickItem)
|
| | | return;
|
| | |
|
| | | if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin) return;
|
| | |
|
| | | //修改后传的是物品id字符串
|
| | | if (type != PackType.Item && type != PackType.DogzItem && type != PackType.GatherSoul && type != PackType.RunePack && type != PackType.default1) return;
|
| | |
|
| | | if (PickItemEvent != null)
|
| | | {
|
| | | PickItemEvent(type, itemIDStr);
|
| | | }
|
| | | }
|
| | |
|
| | | Dictionary<int, ItemModel> RealmBetterDict = new Dictionary<int, ItemModel>();
|
| | | // public Dictionary<int, ItemModel> CheckBetterEquipByRealm()
|
| | |
| | | public class SinglePack |
| | | { |
| | | public readonly PackType type; |
| | | public int unlockedGridCount { get; private set; } |
| | | public int unlockedGridCount { get; private set; } //已开启背包格子数 |
| | | private Dictionary<int, ItemModel> items = new Dictionary<int, ItemModel>(); //key 物品位置索引 |
| | | private Dictionary<int, List<int>> itemIDs = new Dictionary<int, List<int>>(); //key 物品ID:物品位置索引 |
| | | public SinglePack(PackType type) |
| | |
| | | } |
| | | |
| | | public event Action<PackType> refrechPackEvent; //刷新整个背包数据 |
| | | public event Action<PackType, string, bool> ChangeItemEvent; //物品刷新,可能批量创建注意效率; bool:true代表创建 false 刷新 |
| | | public event Action<PackType, string> DeleteItemEvent; //删除物品,可能批量删除注意效率 |
| | | public event Action<PackType, int, int> refreshItemCountEvent; // 慎用会卡(单个)最新物品数量刷新(旧的弃用)在得到新物品、物品数量的改变,清理该物品时均会触发 int 位置索引 int物品id |
| | | public event Action<PackType> gridRefreshEvent; //背包空格刷新 |
| | | public event Action<PackType, int, int> itemCntAddEvent; //物品数量增加 int 位置索引 int物品id |
| | | public event Action<PackType, int, int> itemCntReduceEvent; //物品数量减少的改变 int 位置索引 int物品id |
| | | |
| | | //物品(创建)刷新,可能批量创建注意效率; bool:true代表创建 false 刷新; 注意0707物品数量刷新不包含在此事件 |
| | | public event Action<PackType, string, bool> ChangeItemEvent; // 背包类型,GUID,是否创建 |
| | | |
| | | //删除物品,可能批量删除注意效率 |
| | | public event Action<PackType, string> DeleteItemEvent; // 背包类型,GUID |
| | | |
| | | // 单物品刷新 在得到新物品、物品数量的改变,清理该物品时均会触发 ; 但0725整个背包刷新不触发,如果有需要单独数量刷新事件另外处理 |
| | | // 触发比较频繁,界面使用时可以做个汇总后延迟刷新 |
| | | public event Action<PackType, int, int> RefreshItemEvent; //背包类型,位置索引,物品id |
| | | public event Action<PackType> gridRefreshEvent; //背包可用格子数刷新 |
| | | public event Action<int, int> useItemSuccessEvent; //物品使用成功 int 位置索引 int物品id |
| | | |
| | | public event Action<int> refreshItemDayUseCountEvent; //刷新物品每日使用数量 |
| | |
| | | { |
| | | var itemInfo = new ItemInfo(packInfo.ItemInfo[i]); |
| | | var item = playerPackDict[packType].UpdateItem(itemInfo); |
| | | AddItemGUIDDict(item, false); |
| | | AddItemGUIDDict(item, true); |
| | | |
| | | if (isPlayBetterEquipEffect) |
| | | { |
| | |
| | | var item = playerPackDict[type].UpdateItem(itemInfo); |
| | | AddItemGUIDDict(item, showNewItem); |
| | | |
| | | if (refreshItemCountEvent != null) |
| | | if (RefreshItemEvent != null) |
| | | { |
| | | refreshItemCountEvent(type, itemInfo.index, itemInfo.itemId); |
| | | RefreshItemEvent(type, itemInfo.index, itemInfo.itemId); |
| | | } |
| | | |
| | | if (itemCntAddEvent != null) |
| | | { |
| | | itemCntAddEvent(type, itemInfo.index, itemInfo.itemId); |
| | | } |
| | | |
| | | // if (type == PackType.Equip) |
| | | // { |
| | |
| | | ItemModel itemModel = singlePack.GetItemByIndex(refresh.ItemIndex); |
| | | if (itemModel != null) |
| | | { |
| | | bool isAddItemCount = false; |
| | | if (refresh.ItemCount > itemModel.count) |
| | | { |
| | | isAddItemCount = true; |
| | | } |
| | | |
| | | itemModel.RefreshCount((int)refresh.ItemCount); |
| | | |
| | | if (isAddItemCount) |
| | | if (RefreshItemEvent != null) |
| | | { |
| | | if (itemCntAddEvent != null) |
| | | { |
| | | itemCntAddEvent(type, itemModel.gridIndex, itemModel.itemId); |
| | | } |
| | | ItemLogicUtility.Instance.RefreshPickItem(type, itemModel.itemId.ToString()); |
| | | } |
| | | else |
| | | { |
| | | if (itemCntReduceEvent != null) |
| | | { |
| | | itemCntReduceEvent(type, itemModel.gridIndex, itemModel.itemId); |
| | | } |
| | | } |
| | | |
| | | if (refreshItemCountEvent != null) |
| | | { |
| | | refreshItemCountEvent(type, itemModel.gridIndex, itemModel.itemId); |
| | | RefreshItemEvent(type, itemModel.gridIndex, itemModel.itemId); |
| | | } |
| | | |
| | | } |
| | |
| | | DeleteItemDictByGUID(type, guid); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public void RemoveItem(H0709_tagClearItem clearItem) |
| | |
| | | DeleteItemDictByGUID(type, itemModel.guid); |
| | | |
| | | singlePack.RemoveItem(clearItem.ItemIndex); |
| | | if (refreshItemCountEvent != null) |
| | | if (RefreshItemEvent != null) |
| | | { |
| | | refreshItemCountEvent(type, clearItem.ItemIndex, itemId); |
| | | RefreshItemEvent(type, clearItem.ItemIndex, itemId); |
| | | } |
| | | |
| | | if (itemCntReduceEvent != null) |
| | | { |
| | | itemCntReduceEvent(type, clearItem.ItemIndex, itemId); |
| | | } |
| | | } |
| | | |
| | | UpdatePackRedpoint(type); |
| | |
| | | public void UpdateAutoItemCountRefresh(HA206_tagMCAutoItemCountRefresh netPack) |
| | | { |
| | | |
| | | ShowRewardWin(netPack);//vNetData中ItemCount传的是碎片总数,需要在noPackItemCountDict写入数据之前计算差值 |
| | | for (int i = 0; i < netPack.Count; i++) |
| | | { |
| | | noPackItemCountDict[(int)netPack.ItemCountList[i].ItemID] = (int)netPack.ItemCountList[i].ItemCount; |
| | | } |
| | | OnNoPackItemCountRefresh?.Invoke(); |
| | | } |
| | | |
| | | void ShowRewardWin(HA206_tagMCAutoItemCountRefresh vNetData) |
| | | { |
| | | getA206Count += 1; |
| | | if (ItemLogicUtility.Instance.hidePickItem) |
| | | return; |
| | | // if (ModelCenter.Instance.GetModel<GatheringSoulModel>().isOpenXBWin) |
| | | // return; |
| | | if (getA206Count <= 1 && !isFrist) |
| | | return; |
| | | |
| | | for (int i = 0; i < vNetData.ItemCountList.Length; i++) |
| | | { |
| | | int itemID = (int)vNetData.ItemCountList[i].ItemID; |
| | | int itemCount = (int)vNetData.ItemCountList[i].ItemCount; |
| | | if (noPackItemCountDict.ContainsKey(itemID) && noPackItemCountDict[itemID] > itemCount) |
| | | return; |
| | | ItemLogicUtility.Instance.RefreshPickItem(PackType.Item, itemID.ToString()); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | item.ParsePackItem(items[i].ItemPlace, items[i].ItemData); |
| | | |
| | | ItemLogicUtility.Instance.RefreshPickItem(packType, item.id.ToString()); |
| | | } |
| | | } |
| | | |
| | |
| | | public override void Init()
|
| | | {
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataRefreshEvent;
|
| | | PackManager.Instance.refreshItemCountEvent += OnRefreshItemCountEvent;
|
| | | PackManager.Instance.RefreshItemEvent += OnRefreshItemCountEvent;
|
| | | GlobalTimeEvent.Instance.secondEvent += CheckRedPoint;
|
| | | InitHandler();
|
| | | InitTable();
|
| | |
| | | public override void Release()
|
| | | {
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataRefreshEvent;
|
| | | PackManager.Instance.refreshItemCountEvent -= OnRefreshItemCountEvent;
|
| | | PackManager.Instance.RefreshItemEvent -= OnRefreshItemCountEvent;
|
| | | GlobalTimeEvent.Instance.fiveSecondEvent -= CheckRedPoint;
|
| | | }
|
| | |
|
| | |
| | | { |
| | | None = 0, |
| | | White = 1, |
| | | Blue = 2, |
| | | Purple = 3, |
| | | Orange = 4, |
| | | titleSelectColor = 2, |
| | | titleUnSelectColor = 3, |
| | | |
| | | Red = 5, |
| | | Pink = 6, |
| | | /// <summary> |
| | |
| | | case TextColType.None: |
| | | case TextColType.White: |
| | | return bright ? s_BrightWhiteColor : s_DarkWhiteColor; // s_BrightWhiteColor 是亮底灰色 |
| | | case TextColType.Blue: |
| | | return bright ? s_BrightBlueColor : s_DarkBlueColor; |
| | | case TextColType.Purple: |
| | | return bright ? s_BrightPurpleColor : s_DarkPurpleColor; |
| | | case TextColType.Orange: |
| | | return bright ? s_BrightOrangeColor : s_DarkOrangeColor; |
| | | case TextColType.titleSelectColor: |
| | | return new Color32(114, 157, 228, 255); |
| | | case TextColType.titleUnSelectColor: |
| | | return new Color32(127, 65, 57, 255); |
| | | case TextColType.Red: |
| | | return bright ? s_BrightRedColor : s_DarkRedColor; |
| | | case TextColType.Pink: |
| | |
| | | case TextColType.None: |
| | | case TextColType.White: |
| | | return StringUtility.Contact("<color=#", bright ? "686868" : "f7f7f7", ">", msg, "</color>"); |
| | | case TextColType.Blue: |
| | | return StringUtility.Contact("<color=#", bright ? "006be3" : "31cefb", ">", msg, "</color>"); |
| | | case TextColType.Purple: |
| | | return StringUtility.Contact("<color=#", bright ? "da48d5" : "ec4bf6", ">", msg, "</color>"); |
| | | case TextColType.Orange: |
| | | return StringUtility.Contact("<color=#", bright ? "ff6701" : "f8983b", ">", msg, "</color>"); |
| | | case TextColType.titleSelectColor: |
| | | return StringUtility.Contact("<color=#7F4139>", msg, "</color>"); |
| | | case TextColType.titleUnSelectColor: |
| | | return StringUtility.Contact("<color=#6E5C60>", msg, "</color>"); |
| | | case TextColType.Red: |
| | | return StringUtility.Contact("<color=#", bright ? "ea261e" : "ea261e", ">", msg, "</color>"); |
| | | case TextColType.Pink: |
| | |
| | | { |
| | | switch (itemColor) |
| | | { |
| | | |
| | | case 0: |
| | | return AppendColor(TextColType.Gray, msg, bright); |
| | | case 1: |
| | | return AppendColor(TextColType.White, msg, bright); |
| | | case 2: |
| | | return AppendColor(TextColType.Blue, msg, bright); |
| | | return AppendColor(TextColType.itemjingliang, msg, bright); |
| | | case 3: |
| | | return AppendColor(TextColType.Purple, msg, bright); |
| | | return AppendColor(TextColType.itemxiyou, msg, bright); |
| | | case 4: |
| | | return AppendColor(TextColType.Orange, msg, bright); |
| | | return AppendColor(TextColType.itemshishi, msg, bright); |
| | | case 5: |
| | | return AppendColor(TextColType.Red, msg, bright); |
| | | return AppendColor(TextColType.itemchuanqi, msg, bright); |
| | | case 6: |
| | | return AppendColor(TextColType.itemshenhua, msg, bright); |
| | | case 7: |
| | | return AppendColor(TextColType.itemwuxia, msg, bright); |
| | | case 8: |
| | | return AppendColor(TextColType.Pink, msg, bright); |
| | | return AppendColor(TextColType.itemanjin, msg, bright); |
| | | case 9: |
| | | return AppendColor(TextColType.Green, msg, bright); |
| | | return AppendColor(TextColType.itemjueyi, msg, bright); |
| | | case 10: |
| | | return AppendColor(TextColType.itemyuanzu, msg, bright); |
| | | case 11: |
| | | return AppendColor(TextColType.itembuxiu, msg, bright); |
| | | case 12: |
| | | return AppendColor(TextColType.itemyonghen, msg, bright); |
| | | |
| | | } |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | |
| | | public static Color GetPropertyColor(int property) |
| | | { |