| | |
| | | typeof(GoldRushCampConfig),
|
| | | typeof(GoldRushItemConfig),
|
| | | typeof(GoldRushWorkerConfig),
|
| | | typeof(GubaoConfig),
|
| | | typeof(GubaoLVAttrConfig),
|
| | | typeof(GubaoLVConfig),
|
| | | typeof(GubaoResonanceAttrConfig),
|
| | | typeof(GubaoResonanceConfig),
|
| | | typeof(GubaoStarConfig),
|
| | | typeof(HeroFatesConfig),
|
| | | typeof(HeroFatesQualityLVConfig),
|
| | | typeof(HeroLineupHaloConfig),
|
| | |
| | | typeof(NPCConfig),
|
| | | typeof(NPCExConfig),
|
| | | typeof(NPCLineupConfig),
|
| | | typeof(OPConfigConfig),
|
| | | typeof(OrderInfoConfig),
|
| | | typeof(PlayerAttrConfig),
|
| | | typeof(PlayerFaceConfig),
|
| | |
| | | ClearConfigDictionary<GoldRushItemConfig>();
|
| | | // 清空 GoldRushWorkerConfig 字典
|
| | | ClearConfigDictionary<GoldRushWorkerConfig>();
|
| | | // 清空 GubaoConfig 字典
|
| | | ClearConfigDictionary<GubaoConfig>();
|
| | | // 清空 GubaoLVAttrConfig 字典
|
| | | ClearConfigDictionary<GubaoLVAttrConfig>();
|
| | | // 清空 GubaoLVConfig 字典
|
| | | ClearConfigDictionary<GubaoLVConfig>();
|
| | | // 清空 GubaoResonanceAttrConfig 字典
|
| | | ClearConfigDictionary<GubaoResonanceAttrConfig>();
|
| | | // 清空 GubaoResonanceConfig 字典
|
| | | ClearConfigDictionary<GubaoResonanceConfig>();
|
| | | // 清空 GubaoStarConfig 字典
|
| | | ClearConfigDictionary<GubaoStarConfig>();
|
| | | // 清空 HeroFatesConfig 字典
|
| | | ClearConfigDictionary<HeroFatesConfig>();
|
| | | // 清空 HeroFatesQualityLVConfig 字典
|
| | |
| | | ClearConfigDictionary<NPCExConfig>();
|
| | | // 清空 NPCLineupConfig 字典
|
| | | ClearConfigDictionary<NPCLineupConfig>();
|
| | | // 清空 OPConfigConfig 字典
|
| | | ClearConfigDictionary<OPConfigConfig>();
|
| | | // 清空 OrderInfoConfig 字典
|
| | | ClearConfigDictionary<OrderInfoConfig>();
|
| | | // 清空 PlayerAttrConfig 字典
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: Wednesday, January 7, 2026
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class GubaoConfig : ConfigBase<int, GubaoConfig>
|
| | | {
|
| | | static GubaoConfig()
|
| | | {
|
| | | // 访问过静态构造函数
|
| | | visit = true; |
| | | }
|
| | |
|
| | | public int GubaoID;
|
| | | public string Name;
|
| | | public int GubaoQuality;
|
| | | public int UnlockItemID;
|
| | | public int UnlockItemCnt;
|
| | | public int[] BaseAttrIDList;
|
| | | public int[] BaseAttrValueList;
|
| | | public int[] BaseAttrPerStarAddList;
|
| | | public int SpecEffType;
|
| | | public int SpecEffLayerMax;
|
| | | public int SpecAttrID;
|
| | | public int SpecAttrValue;
|
| | | public int SpecAttrPerStarAdd;
|
| | | public int PowerType;
|
| | | public int PowerTypeValue;
|
| | | public int PowerValue;
|
| | | public int PowerPerStarAdd;
|
| | | public string Icon;
|
| | | public string Desc;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | | int key = GetKey(_key);
|
| | | return key;
|
| | | }
|
| | |
|
| | | public override void LoadConfig(string input)
|
| | | {
|
| | | try {
|
| | | string[] tables = input.Split('\t');
|
| | | int.TryParse(tables[0],out GubaoID); |
| | |
|
| | | Name = tables[1];
|
| | |
|
| | | int.TryParse(tables[2],out GubaoQuality); |
| | |
|
| | | int.TryParse(tables[3],out UnlockItemID); |
| | |
|
| | | int.TryParse(tables[4],out UnlockItemCnt); |
| | |
|
| | | if (tables[5].Contains("[")) |
| | | { |
| | | BaseAttrIDList = JsonMapper.ToObject<int[]>(tables[5]); |
| | | } |
| | | else |
| | | { |
| | | string[] BaseAttrIDListStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | BaseAttrIDList = new int[BaseAttrIDListStringArray.Length]; |
| | | for (int i=0;i<BaseAttrIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(BaseAttrIDListStringArray[i],out BaseAttrIDList[i]); |
| | | } |
| | | }
|
| | |
|
| | | if (tables[6].Contains("[")) |
| | | { |
| | | BaseAttrValueList = JsonMapper.ToObject<int[]>(tables[6]); |
| | | } |
| | | else |
| | | { |
| | | string[] BaseAttrValueListStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | BaseAttrValueList = new int[BaseAttrValueListStringArray.Length]; |
| | | for (int i=0;i<BaseAttrValueListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(BaseAttrValueListStringArray[i],out BaseAttrValueList[i]); |
| | | } |
| | | }
|
| | |
|
| | | if (tables[7].Contains("[")) |
| | | { |
| | | BaseAttrPerStarAddList = JsonMapper.ToObject<int[]>(tables[7]); |
| | | } |
| | | else |
| | | { |
| | | string[] BaseAttrPerStarAddListStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | BaseAttrPerStarAddList = new int[BaseAttrPerStarAddListStringArray.Length]; |
| | | for (int i=0;i<BaseAttrPerStarAddListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(BaseAttrPerStarAddListStringArray[i],out BaseAttrPerStarAddList[i]); |
| | | } |
| | | }
|
| | |
|
| | | int.TryParse(tables[8],out SpecEffType); |
| | |
|
| | | int.TryParse(tables[9],out SpecEffLayerMax); |
| | |
|
| | | int.TryParse(tables[10],out SpecAttrID); |
| | |
|
| | | int.TryParse(tables[11],out SpecAttrValue); |
| | |
|
| | | int.TryParse(tables[12],out SpecAttrPerStarAdd); |
| | |
|
| | | int.TryParse(tables[13],out PowerType); |
| | |
|
| | | int.TryParse(tables[14],out PowerTypeValue); |
| | |
|
| | | int.TryParse(tables[15],out PowerValue); |
| | |
|
| | | int.TryParse(tables[16],out PowerPerStarAdd); |
| | |
|
| | | Icon = tables[17];
|
| | |
|
| | | Desc = tables[18];
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 97ccaceffe1621547a704b5e8dcb5290 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2026年1月6日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class GubaoLVAttrConfig : ConfigBase<int, GubaoLVAttrConfig>
|
| | | {
|
| | | static GubaoLVAttrConfig()
|
| | | {
|
| | | // 访问过静态构造函数
|
| | | visit = true; |
| | | }
|
| | |
|
| | | public int Id;
|
| | | public int GubaoQuality;
|
| | | public int GubaoLV;
|
| | | public int[] SpecAttrIDList;
|
| | | public int[] SpecAttrValueList;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | | int key = GetKey(_key);
|
| | | return key;
|
| | | }
|
| | |
|
| | | public override void LoadConfig(string input)
|
| | | {
|
| | | try {
|
| | | string[] tables = input.Split('\t');
|
| | | int.TryParse(tables[0],out Id); |
| | |
|
| | | int.TryParse(tables[1],out GubaoQuality); |
| | |
|
| | | int.TryParse(tables[2],out GubaoLV); |
| | |
|
| | | if (tables[3].Contains("[")) |
| | | { |
| | | SpecAttrIDList = JsonMapper.ToObject<int[]>(tables[3]); |
| | | } |
| | | else |
| | | { |
| | | string[] SpecAttrIDListStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | SpecAttrIDList = new int[SpecAttrIDListStringArray.Length]; |
| | | for (int i=0;i<SpecAttrIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(SpecAttrIDListStringArray[i],out SpecAttrIDList[i]); |
| | | } |
| | | }
|
| | |
|
| | | if (tables[4].Contains("[")) |
| | | { |
| | | SpecAttrValueList = JsonMapper.ToObject<int[]>(tables[4]); |
| | | } |
| | | else |
| | | { |
| | | string[] SpecAttrValueListStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | SpecAttrValueList = new int[SpecAttrValueListStringArray.Length]; |
| | | for (int i=0;i<SpecAttrValueListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(SpecAttrValueListStringArray[i],out SpecAttrValueList[i]); |
| | | } |
| | | }
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 786cd395d0aa20140aa3c0bc17fc9ca0 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2026年1月5日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class GubaoLVConfig : ConfigBase<int, GubaoLVConfig>
|
| | | {
|
| | | static GubaoLVConfig()
|
| | | {
|
| | | // 访问过静态构造函数
|
| | | visit = true; |
| | | }
|
| | |
|
| | | public int ID;
|
| | | public int GubaoQuality;
|
| | | public int LessEqualLV;
|
| | | public int[][] LVUPNeedItemInfo;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | | int key = GetKey(_key);
|
| | | return key;
|
| | | }
|
| | |
|
| | | public override void LoadConfig(string input)
|
| | | {
|
| | | try {
|
| | | string[] tables = input.Split('\t');
|
| | | int.TryParse(tables[0],out ID); |
| | |
|
| | | int.TryParse(tables[1],out GubaoQuality); |
| | |
|
| | | int.TryParse(tables[2],out LessEqualLV); |
| | |
|
| | | LVUPNeedItemInfo = JsonMapper.ToObject<int[][]>(tables[3].Replace("(", "[").Replace(")", "]")); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 48b737ca9a836af42b142bfc63d53909 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2026年1月5日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class GubaoResonanceAttrConfig : ConfigBase<int, GubaoResonanceAttrConfig>
|
| | | {
|
| | | static GubaoResonanceAttrConfig()
|
| | | {
|
| | | // 访问过静态构造函数
|
| | | visit = true; |
| | | }
|
| | |
|
| | | public int ID;
|
| | | public int ResonanceID;
|
| | | public int ResonanceStar;
|
| | | public int[] ResonanceAttrIDList;
|
| | | public int[] ResonanceAttrValueList;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | | int key = GetKey(_key);
|
| | | return key;
|
| | | }
|
| | |
|
| | | public override void LoadConfig(string input)
|
| | | {
|
| | | try {
|
| | | string[] tables = input.Split('\t');
|
| | | int.TryParse(tables[0],out ID); |
| | |
|
| | | int.TryParse(tables[1],out ResonanceID); |
| | |
|
| | | int.TryParse(tables[2],out ResonanceStar); |
| | |
|
| | | if (tables[3].Contains("[")) |
| | | { |
| | | ResonanceAttrIDList = JsonMapper.ToObject<int[]>(tables[3]); |
| | | } |
| | | else |
| | | { |
| | | string[] ResonanceAttrIDListStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | ResonanceAttrIDList = new int[ResonanceAttrIDListStringArray.Length]; |
| | | for (int i=0;i<ResonanceAttrIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(ResonanceAttrIDListStringArray[i],out ResonanceAttrIDList[i]); |
| | | } |
| | | }
|
| | |
|
| | | if (tables[4].Contains("[")) |
| | | { |
| | | ResonanceAttrValueList = JsonMapper.ToObject<int[]>(tables[4]); |
| | | } |
| | | else |
| | | { |
| | | string[] ResonanceAttrValueListStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | ResonanceAttrValueList = new int[ResonanceAttrValueListStringArray.Length]; |
| | | for (int i=0;i<ResonanceAttrValueListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(ResonanceAttrValueListStringArray[i],out ResonanceAttrValueList[i]); |
| | | } |
| | | }
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5f751bf28288b7d4c898c3b44ca6350d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2026年1月5日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class GubaoResonanceConfig : ConfigBase<int, GubaoResonanceConfig>
|
| | | {
|
| | | static GubaoResonanceConfig()
|
| | | {
|
| | | // 访问过静态构造函数
|
| | | visit = true; |
| | | }
|
| | |
|
| | | public int ResonanceID;
|
| | | public string ResonanceName;
|
| | | public int[] GubaoIDList;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | | int key = GetKey(_key);
|
| | | return key;
|
| | | }
|
| | |
|
| | | public override void LoadConfig(string input)
|
| | | {
|
| | | try {
|
| | | string[] tables = input.Split('\t');
|
| | | int.TryParse(tables[0],out ResonanceID); |
| | |
|
| | | ResonanceName = tables[1];
|
| | |
|
| | | if (tables[2].Contains("[")) |
| | | { |
| | | GubaoIDList = JsonMapper.ToObject<int[]>(tables[2]); |
| | | } |
| | | else |
| | | { |
| | | string[] GubaoIDListStringArray = tables[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | GubaoIDList = new int[GubaoIDListStringArray.Length]; |
| | | for (int i=0;i<GubaoIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(GubaoIDListStringArray[i],out GubaoIDList[i]); |
| | | } |
| | | }
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: caf00848b1605d341accaef4e81e39f4 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2026年1月6日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class GubaoStarConfig : ConfigBase<int, GubaoStarConfig>
|
| | | {
|
| | | static GubaoStarConfig()
|
| | | {
|
| | | // 访问过静态构造函数
|
| | | visit = true; |
| | | }
|
| | |
|
| | | public int ID;
|
| | | public int GubaoQuality;
|
| | | public int GubaoStar;
|
| | | public int[] Condition;
|
| | | public int StarUPNeedSelfCnt;
|
| | | public int[][] StarUPNeedItemList;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | | int key = GetKey(_key);
|
| | | return key;
|
| | | }
|
| | |
|
| | | public override void LoadConfig(string input)
|
| | | {
|
| | | try {
|
| | | string[] tables = input.Split('\t');
|
| | | int.TryParse(tables[0],out ID); |
| | |
|
| | | int.TryParse(tables[1],out GubaoQuality); |
| | |
|
| | | int.TryParse(tables[2],out GubaoStar); |
| | |
|
| | | if (tables[3].Contains("[")) |
| | | { |
| | | Condition = JsonMapper.ToObject<int[]>(tables[3]); |
| | | } |
| | | else |
| | | { |
| | | string[] ConditionStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | Condition = new int[ConditionStringArray.Length]; |
| | | for (int i=0;i<ConditionStringArray.Length;i++) |
| | | { |
| | | int.TryParse(ConditionStringArray[i],out Condition[i]); |
| | | } |
| | | }
|
| | |
|
| | | int.TryParse(tables[4],out StarUPNeedSelfCnt); |
| | |
|
| | | StarUPNeedItemList = JsonMapper.ToObject<int[][]>(tables[5].Replace("(", "[").Replace(")", "]")); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1caa48b80ad4f8849910f600c8de060d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | public partial class GubaoConfig : ConfigBase<int, GubaoConfig> |
| | | { |
| | | |
| | | public static Dictionary<int, List<int>> gubaoQualityDict = new Dictionary<int, List<int>>(); |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!gubaoQualityDict.ContainsKey(GubaoQuality)) |
| | | { |
| | | gubaoQualityDict[GubaoQuality] = new List<int>(); |
| | | } |
| | | gubaoQualityDict[GubaoQuality].Add(GubaoID); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e988c089f33c6ce4f861d00cb9c20b0e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | public partial class GubaoLVAttrConfig : ConfigBase<int, GubaoLVAttrConfig> |
| | | { |
| | | static Dictionary<int, Dictionary<int, GubaoLVAttrConfig>> gubaoSpecLVAttrDict = new Dictionary<int, Dictionary<int, GubaoLVAttrConfig>>(); |
| | | static Dictionary<int, int> maxLVDict = new Dictionary<int, int>(); |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!gubaoSpecLVAttrDict.ContainsKey(GubaoQuality)) |
| | | { |
| | | gubaoSpecLVAttrDict[GubaoQuality] = new Dictionary<int, GubaoLVAttrConfig>(); |
| | | } |
| | | gubaoSpecLVAttrDict[GubaoQuality][GubaoLV] = this; |
| | | |
| | | if (!maxLVDict.ContainsKey(GubaoQuality)) |
| | | { |
| | | maxLVDict[GubaoQuality] = GubaoLV; |
| | | } |
| | | else if (maxLVDict[GubaoQuality] < GubaoLV) |
| | | { |
| | | maxLVDict[GubaoQuality] = GubaoLV; |
| | | } |
| | | } |
| | | |
| | | // 古宝的指定属性ID对应的成长值 |
| | | public static long GetSpecLVAttrValue(int gubaoQuality, int gubaoLV, int specAttrID) |
| | | { |
| | | if (gubaoSpecLVAttrDict.ContainsKey(gubaoQuality) && gubaoSpecLVAttrDict[gubaoQuality].ContainsKey(gubaoLV)) |
| | | { |
| | | for (int i = 0; i < gubaoSpecLVAttrDict[gubaoQuality][gubaoLV].SpecAttrIDList.Length; i++) |
| | | { |
| | | if (gubaoSpecLVAttrDict[gubaoQuality][gubaoLV].SpecAttrIDList[i] == specAttrID) |
| | | { |
| | | return gubaoSpecLVAttrDict[gubaoQuality][gubaoLV].SpecAttrValueList[i]; |
| | | } |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public static int GetMaxLV(int gubaoQuality) |
| | | { |
| | | if (maxLVDict.ContainsKey(gubaoQuality)) |
| | | { |
| | | return maxLVDict[gubaoQuality]; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 41d470e2f985a294595eac5522e6e8b9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | public partial class GubaoLVConfig : ConfigBase<int, GubaoLVConfig> |
| | | { |
| | | public static List<int> useItemIDS = new List<int>(); // 使用的物品ID列表 刷新通知用 |
| | | static Dictionary<int, Dictionary<int, GubaoLVConfig>> lvConfigDict = new Dictionary<int, Dictionary<int, GubaoLVConfig>>(); |
| | | |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!lvConfigDict.ContainsKey(GubaoQuality)) |
| | | { |
| | | lvConfigDict[GubaoQuality] = new Dictionary<int, GubaoLVConfig>(); |
| | | } |
| | | lvConfigDict[GubaoQuality][LessEqualLV] = this; |
| | | for (int i = 0; i < LVUPNeedItemInfo.Length; i++) |
| | | { |
| | | if (!useItemIDS.Contains(LVUPNeedItemInfo[i][0])) |
| | | { |
| | | useItemIDS.Add(LVUPNeedItemInfo[i][0]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public static GubaoLVConfig GetConfig(int quality, int lv) |
| | | { |
| | | //LessEqualLV 的记录是 升级目标小于等于这个等级的配置,需判断lv; 即取下一级的配置 |
| | | if (lvConfigDict.ContainsKey(quality)) |
| | | { |
| | | var items = lvConfigDict[quality].Values.ToList(); |
| | | items.Sort((a, b) => a.LessEqualLV.CompareTo(b.LessEqualLV)); |
| | | foreach (var item in items) |
| | | { |
| | | if (lv < item.LessEqualLV) |
| | | { |
| | | return item; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73a99158432537d4992da24b2639ff4d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | public partial class GubaoStarConfig : ConfigBase<int, GubaoStarConfig> |
| | | { |
| | | public static List<int> useItemIDS = new List<int>(); // 使用的物品ID列表 刷新通知用 |
| | | static Dictionary<int, Dictionary<int, GubaoStarConfig>> starConfigDict = new Dictionary<int, Dictionary<int, GubaoStarConfig>>(); |
| | | static Dictionary<int, int> maxStarDict = new Dictionary<int, int>(); |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!starConfigDict.ContainsKey(GubaoQuality)) |
| | | { |
| | | starConfigDict[GubaoQuality] = new Dictionary<int, GubaoStarConfig>(); |
| | | } |
| | | starConfigDict[GubaoQuality][GubaoStar] = this; |
| | | for (int i = 0; i < StarUPNeedItemList.Length; i++) |
| | | { |
| | | if (!useItemIDS.Contains(StarUPNeedItemList[i][0])) |
| | | { |
| | | useItemIDS.Add(StarUPNeedItemList[i][0]); |
| | | } |
| | | } |
| | | |
| | | if (!maxStarDict.ContainsKey(GubaoQuality)) |
| | | { |
| | | maxStarDict[GubaoQuality] = GubaoStar; |
| | | } |
| | | else if (maxStarDict[GubaoQuality] < GubaoStar) |
| | | { |
| | | maxStarDict[GubaoQuality] = GubaoStar; |
| | | } |
| | | } |
| | | |
| | | public static GubaoStarConfig GetConfig(int quality, int star) |
| | | { |
| | | if (starConfigDict.ContainsKey(quality)) |
| | | { |
| | | if (starConfigDict[quality].ContainsKey(star)) |
| | | { |
| | | return starConfigDict[quality][star]; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static int GetMaxStar(int gubaoQuality) |
| | | { |
| | | if (maxStarDict.ContainsKey(gubaoQuality)) |
| | | { |
| | | return maxStarDict[gubaoQuality]; |
| | | } |
| | | return 0; |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: aaf2c3c60e90e4444b40021b9ea063ed |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | return GetValueDescriptionEx(id, value, largeNumFormat); |
| | | } |
| | | |
| | | public static string GetValueDescriptionEx(int id, long value, int largeNumFormat = 2) |
| | | //带格式 |
| | | public static string GetValueDescriptionFormat(int id, long value, int largeNumFormat = 2, string format="+{0}") |
| | | { |
| | | return string.Format(format, GetValueDescriptionEx(id, value, largeNumFormat)); |
| | | } |
| | | |
| | | static string GetValueDescriptionEx(int id, long value, int largeNumFormat = 2) |
| | | { |
| | | var config = Get(id); |
| | | if (config == null) |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B2 16 古宝激活 #tagCMGubaoActivate
|
| | |
|
| | | public class CB216_tagCMGubaoActivate : GameNetPackBasic {
|
| | | public ushort GubaoID;
|
| | |
|
| | | public CB216_tagCMGubaoActivate () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xB216;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (GubaoID, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4b6850273686799418d5085ab470fb2a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B2 17 古宝升星 #tagCMGubaoStarUp
|
| | |
|
| | | public class CB217_tagCMGubaoStarUp : GameNetPackBasic {
|
| | | public ushort GubaoID;
|
| | |
|
| | | public CB217_tagCMGubaoStarUp () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xB217;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (GubaoID, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a71f795baf8d4914699f52bb22a0f91c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B2 18 古宝升级 #tagCMGubaoLVUp
|
| | |
|
| | | public class CB218_tagCMGubaoLVUp : GameNetPackBasic {
|
| | | public ushort GubaoID;
|
| | |
|
| | | public CB218_tagCMGubaoLVUp () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xB218;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (GubaoID, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e6b331cfe08316a41a340ad69f56e262 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | {
|
| | | base.Done(vNetPack);
|
| | | HA204_tagMCVPackRefresh vNetData = vNetPack as HA204_tagMCVPackRefresh;
|
| | | VirtualPackManager.Instance.OnReceiveServerPack(vNetData);
|
| | | // VirtualPackManager.Instance.OnReceiveServerPack(vNetData);
|
| | | }
|
| | | }
|
| | |
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA205_tagMCVPackClear vNetData = vNetPack as HA205_tagMCVPackClear;
|
| | | VirtualPackManager.Instance.OnReceiveServerPack(vNetData);
|
| | | // VirtualPackManager.Instance.OnReceiveServerPack(vNetData);
|
| | | }
|
| | | }
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A3 C7 古宝信息 #tagMCGubaoInfo
|
| | |
|
| | | public class DTCA3C7_tagMCGubaoInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA3C7_tagMCGubaoInfo vNetData = vNetPack as HA3C7_tagMCGubaoInfo;
|
| | | GubaoManager.Instance.UpdateGubaoNetPack(vNetData);
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 25a8641c031f0aa42b7e7fd5746095bc |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | Register(typeof(H0707_tagItemCountRefresh), typeof(DTC0707_tagItemCountRefresh)); |
| | | Register(typeof(H0709_tagClearItem), typeof(DTC0709_tagClearItem)); |
| | | Register(typeof(H0711_tagClearItemPack), typeof(DTC0711_tagClearItemPack)); |
| | | Register(typeof(HA204_tagMCVPackRefresh), typeof(DTCA204_tagMCVPackRefresh)); |
| | | Register(typeof(HA205_tagMCVPackClear), typeof(DTCA205_tagMCVPackClear)); |
| | | // Register(typeof(HA204_tagMCVPackRefresh), typeof(DTCA204_tagMCVPackRefresh)); |
| | | // Register(typeof(HA205_tagMCVPackClear), typeof(DTCA205_tagMCVPackClear)); |
| | | Register(typeof(HA206_tagMCAutoItemCountRefresh), typeof(DTCA206_tagMCAutoItemCountRefresh)); |
| | | Register(typeof(HA710_tagMCGuideState), typeof(DTCA710_tagMCGuideState)); |
| | | Register(typeof(H0418_tagObjInfoRefresh), typeof(DTC0418_tagObjInfoRefresh)); |
| | |
| | | Register(typeof(HB131_tagSCHeroFatesInfo), typeof(DTCB131_tagSCHeroFatesInfo)); |
| | | Register(typeof(HB130_tagSCBeautyInfo), typeof(DTCB130_tagSCBeautyInfo)); |
| | | Register(typeof(HB040_tagSCTravelInfo), typeof(DTCB040_tagSCTravelInfo)); |
| | | Register(typeof(HA3C7_tagMCGubaoInfo), typeof(DTCA3C7_tagMCGubaoInfo)); |
| | | } |
| | | |
| | | //主工程注册封包 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A3 C7 古宝信息 #tagMCGubaoInfo
|
| | |
|
| | | public class HA3C7_tagMCGubaoInfo : GameNetPackBasic {
|
| | | public ushort Count;
|
| | | public tagMCGubao[] GubaoInfoList;
|
| | |
|
| | | public HA3C7_tagMCGubaoInfo () {
|
| | | _cmd = (ushort)0xA3C7;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Count, vBytes, NetDataType.WORD);
|
| | | GubaoInfoList = new tagMCGubao[Count];
|
| | | for (int i = 0; i < Count; i ++) {
|
| | | GubaoInfoList[i] = new tagMCGubao();
|
| | | TransBytes (out GubaoInfoList[i].GubaoID, vBytes, NetDataType.WORD);
|
| | | TransBytes (out GubaoInfoList[i].GubaoStar, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out GubaoInfoList[i].GubaoLV, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out GubaoInfoList[i].EffLayer, vBytes, NetDataType.WORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public class tagMCGubao {
|
| | | public ushort GubaoID;
|
| | | public byte GubaoStar;
|
| | | public byte GubaoLV;
|
| | | public ushort EffLayer; // 该特殊效果累加层值
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 8ba431a20165a6145b8e0d86a889c682 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | managers.Add(HeroFatesManager.Instance);
|
| | | managers.Add(BeautyMMManager.Instance);
|
| | | managers.Add(DailySpecialsManager.Instance);
|
| | | managers.Add(GubaoManager.Instance);
|
| | | foreach (var manager in managers)
|
| | | {
|
| | | manager.Init();
|
| | |
| | | set { LocalSave.SetString("InGameDownLoadCompleteAccount", value); } |
| | | } |
| | | |
| | | public Redpoint downLoadRedpoint = new Redpoint(MainRedDot.RedPoint_Download); |
| | | |
| | | private void Awake() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | downLoadRedpoint.state = state == State.Award ? RedPointState.Simple : RedPointState.None; |
| | | MainRedDot.Instance.downLoadRedpoint.state = state == State.Award ? RedPointState.Simple : RedPointState.None; |
| | | |
| | | if (onDownLoadOk != null) |
| | | { |
| | |
| | | state = !hasReward && completeDownLoadAccount == PlayerDatas.Instance.baseData.AccID ? State.Award : State.Completed; |
| | | } |
| | | |
| | | downLoadRedpoint.state = state == State.Award ? RedPointState.Simple : RedPointState.None; |
| | | MainRedDot.Instance.downLoadRedpoint.state = state == State.Award ? RedPointState.Simple : RedPointState.None; |
| | | } |
| | | |
| | | public void RequestDownLoadReward() |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9054f2d1e012d21458dc12cc8a624e00 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 古宝激活成功 |
| | | /// 外部查看类型 0完整tip(可切满级) 1 只有基础满级不可切换 2 只有套装 |
| | | /// 内部可切换当前0 和 完整1 |
| | | /// </summary> |
| | | public class GubaoActiveWin : UIBase |
| | | { |
| | | [SerializeField] ImageEx gbImg; |
| | | [SerializeField] UIEffectPlayer gbBGEffect; |
| | | [SerializeField] UIEffectPlayer gbEffect; |
| | | [SerializeField] Text nameText; |
| | | //基础属性 |
| | | [SerializeField] Text[] attrBaseTexts; |
| | | [SerializeField] Text attrSpecialText; |
| | | [SerializeField] Transform attrPrivilegeRect; |
| | | [SerializeField] Text attrPrivilegeText; |
| | | |
| | | [SerializeField] Button okBtn; |
| | | |
| | | int gubaoID = 0; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | okBtn.AddListener(CloseWindow); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | gubaoID = functionOrder; |
| | | Display(); |
| | | } |
| | | |
| | | |
| | | public void Display() |
| | | { |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | gbImg.SetOrgSprite(config.Icon, "gbicon"); |
| | | gbImg.SetNativeSize(); |
| | | |
| | | var gbData = GubaoManager.Instance.TryGetGubaoInfo(gubaoID); |
| | | gbBGEffect.PlayByArrIndex(gbData.Quality - 2); |
| | | gbEffect.PlayByArrIndex(gbData.Quality - 2); |
| | | nameText.text = config.Name; |
| | | nameText.color = UIHelper.GetFuncQualityColor(gbData.Quality); |
| | | ShowAttr(config); |
| | | } |
| | | |
| | | void ShowAttr(GubaoConfig config) |
| | | { |
| | | //基础属性 |
| | | var attrDict = GubaoManager.Instance.GetBaseAttrByGBID(gubaoID); |
| | | for (int i = 0; i < attrBaseTexts.Length; i++) |
| | | { |
| | | if (i < config.BaseAttrIDList.Length) |
| | | { |
| | | attrBaseTexts[i].SetActive(true); |
| | | attrBaseTexts[i].text = PlayerPropertyConfig.GetFullDescription(config.BaseAttrIDList[i], attrDict[config.BaseAttrIDList[i]]); |
| | | } |
| | | else |
| | | { |
| | | attrBaseTexts[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | //特殊属性:只有一个属性,第一行单层属性,第二行为特效效果层级加成汇总 |
| | | //分两种情况 |
| | | //无任何效果的正常升星升级显示第一行,第二行隐藏 |
| | | //有特殊层级的:如果为0,则第一行只显示单行的属性和提升,第二行显示数值0;如果不为0,则第一行显示单行属性和提升,第二行显示数值 |
| | | //有特权效果的亦同 |
| | | var specAttrDict = GubaoManager.Instance.GetSpecialAttrByGBID(gubaoID, true); |
| | | if (config.SpecEffType == 0) |
| | | { |
| | | attrSpecialText.text = PlayerPropertyConfig.GetFullDescription(config.SpecAttrID, specAttrDict[config.SpecAttrID]); |
| | | } |
| | | else |
| | | { |
| | | //有特殊效果的 |
| | | var singleLayerAttrDict = GubaoManager.Instance.GetSpecialAttrSingleLayerByGBID(gubaoID); |
| | | attrSpecialText.text = Language.Get("Gubao22_" + config.SpecEffType) + PlayerPropertyConfig.GetFullDescription(config.SpecAttrID, singleLayerAttrDict[config.SpecAttrID]); |
| | | } |
| | | if (config.PowerType != 0) |
| | | { |
| | | // 1 游历双倍奖励概率 无 增加万分率 万分率 |
| | | // 2 月卡领取额外奖励 物品ID 提升百分比 百分比 |
| | | |
| | | //有特权效果的 非属性类 |
| | | attrPrivilegeRect.SetActive(true); |
| | | var valueDict = GubaoManager.Instance.GetPrivilegeValueByGBID(gubaoID, true); |
| | | if (config.PowerType == 1) |
| | | { |
| | | attrPrivilegeText.text = Language.Get("Gubao23_" + config.PowerType, valueDict[config.PowerType] / 100.0); |
| | | } |
| | | else if (config.PowerType == 2) |
| | | { |
| | | attrPrivilegeText.text = Language.Get("Gubao23_" + config.PowerType, ItemConfig.Get(config.PowerTypeValue).ItemName, valueDict[config.PowerType]); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | attrPrivilegeRect.SetActive(false); |
| | | } |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 88840ea3d5ffae142931dacc80cb1b34 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | /// <summary> |
| | | /// 古宝基础界面 |
| | | /// </summary> |
| | | public class GubaoBaseWin : OneLevelWin |
| | | { |
| | | protected override void OpenSubUIByTabIndex() |
| | | { |
| | | switch (functionOrder) |
| | | { |
| | | case 0: |
| | | currentSubUI = UIManager.Instance.OpenWindow<GubaoListWin>(); |
| | | break; |
| | | case 1: |
| | | // 充值界面 |
| | | // currentSubUI = UIManager.Instance.OpenWindow<RechargeWin>(); |
| | | break; |
| | | default: |
| | | Debug.LogWarning("未知的标签索引: " + functionOrder); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 336cf62e928024346bd1ef43ab2ad091 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class GubaoCell : MonoBehaviour |
| | | { |
| | | [SerializeField] Button gbBtn; |
| | | [SerializeField] ImageEx gbImg; |
| | | [SerializeField] Image gbBGImg; |
| | | [SerializeField] UIEffectPlayer gbBGEffect; |
| | | [SerializeField] UIEffectPlayer gbEffect; |
| | | [SerializeField] Image canActiveImg; |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] Text lvText; |
| | | [SerializeField] Transform starRect; |
| | | [SerializeField] Image[] starImgs; |
| | | [SerializeField] Transform processRect; |
| | | [SerializeField] Image processImg; |
| | | [SerializeField] Text processText; |
| | | [SerializeField] Image fullProcessImg; |
| | | [SerializeField] Image redImg; |
| | | |
| | | |
| | | public void Display(int quality, int index) |
| | | { |
| | | var gubaoID = GubaoManager.Instance.gubaoCollectDict[quality][index]; |
| | | gbBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<GubaoDetailWin>(gubaoID); |
| | | }); |
| | | |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | gbImg.SetOrgSprite(config.Icon, "gbicon"); |
| | | gbImg.SetNativeSize(); |
| | | gbBGImg.SetSprite($"GubaoBG{quality}"); |
| | | |
| | | var gbData = GubaoManager.Instance.TryGetGubaoInfo(gubaoID); |
| | | int lv = 0; |
| | | int star = 0; |
| | | if (gbData != null) |
| | | { |
| | | lv = gbData.GubaoLV; |
| | | star = gbData.GubaoStar; |
| | | gbImg.gray = false; |
| | | canActiveImg.SetActive(false); |
| | | starRect.SetActive(true); |
| | | for (int i = 0; i < starImgs.Length; i++) |
| | | { |
| | | if (i < star) |
| | | { |
| | | starImgs[i].SetActive(true); |
| | | //循环不同图 |
| | | int starIndex = star / starImgs.Length * starImgs.Length + i + 1; |
| | | if (starIndex > star) |
| | | { |
| | | starIndex -= starImgs.Length; |
| | | } |
| | | starImgs[i].SetSprite($"GubaoStar{starIndex}"); |
| | | } |
| | | else |
| | | { |
| | | starImgs[i].SetActive(false); |
| | | } |
| | | } |
| | | processRect.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | gbImg.gray = true; |
| | | canActiveImg.SetActive(GubaoManager.Instance.CanActiveGubao(gubaoID)); |
| | | starRect.SetActive(false); |
| | | processRect.SetActive(true); |
| | | var cnt = VirtualPackManager.Instance.GetNoPackItemCount(config.UnlockItemID); |
| | | float value = cnt*1.0f / config.UnlockItemCnt; |
| | | processImg.fillAmount = value; |
| | | fullProcessImg.SetActive(value >= 1); |
| | | processText.text = $"{cnt}/{config.UnlockItemCnt}"; |
| | | } |
| | | gbBGEffect.PlayByArrIndex(quality - 2); |
| | | if (GubaoManager.Instance.IsActive(gubaoID)) |
| | | { |
| | | gbEffect.PlayByArrIndex(quality - 2); |
| | | } |
| | | else |
| | | { |
| | | gbEffect.Stop(); |
| | | } |
| | | nameText.text = config.Name; |
| | | nameText.color = UIHelper.GetFuncQualityColor(quality); |
| | | lvText.text = lv == 0 ? "" : Language.Get("L1113", lv); |
| | | redImg.SetActive(GubaoManager.Instance.IsRedTip(gubaoID)); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: edea553bfc2595746989b1386fefe74b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 古宝详情界面 - 分 合成 和 升星/升级两部分 |
| | | /// </summary> |
| | | public class GubaoDetailWin : UIBase |
| | | { |
| | | [SerializeField] ImageEx gbImg; |
| | | [SerializeField] Image gbBGImg; |
| | | [SerializeField] UIEffectPlayer gbBGEffect; |
| | | [SerializeField] UIEffectPlayer gbEffect; |
| | | [SerializeField] UIEffectPlayer lvupEffect; |
| | | [SerializeField] UIEffectPlayer starupEffect; |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] Text lvText; |
| | | [SerializeField] Image[] starImgs; |
| | | [SerializeField] Button seeSuiteBtn; |
| | | [SerializeField] Button seeFullBtn; |
| | | [SerializeField] Text descText; |
| | | [SerializeField] Text wayText; |
| | | |
| | | //基础属性 |
| | | [SerializeField] Transform[] attrBaseRects; |
| | | [SerializeField] Text[] attrBaseTexts; |
| | | |
| | | //特殊属性 |
| | | [SerializeField] Transform[] attrSpecialRects; //被动属性只有一个,但有特殊加成说明排版 |
| | | [SerializeField] Text[] attrSpecialTexts; |
| | | |
| | | //特权 只有升星有 |
| | | [SerializeField] Transform attrPrivilegeRect; |
| | | [SerializeField] Text attrPrivilegeText; |
| | | [SerializeField] Transform addPrivilegeRect; |
| | | [SerializeField] Text addPrivilegeText; |
| | | |
| | | //升星/升级部分 |
| | | [SerializeField] Transform[] addAttrBaseRects; |
| | | [SerializeField] Text[] addAttrBaseTexts; |
| | | [SerializeField] Transform[] addAttrSpecialRects; |
| | | [SerializeField] Text[] addAttrSpecialTexts; |
| | | [SerializeField] Image lvStarBGImg; |
| | | [SerializeField] Transform opBtns; |
| | | [SerializeField] GroupButtonEx lvupTabBtn; |
| | | [SerializeField] GroupButtonEx starupTabBtn; |
| | | [SerializeField] Text starUpTabNameText; |
| | | [SerializeField] Image lvupRedImg; |
| | | [SerializeField] Image starupRedImg; |
| | | [SerializeField] Button lvupBtn; |
| | | [SerializeField] Image itemIconImg; |
| | | [SerializeField] Text itemCntText; |
| | | [SerializeField] Button starupBtn; |
| | | [SerializeField] Text starUpNameText; |
| | | [SerializeField] Transform fullRect; |
| | | [SerializeField] Text fullLVStarText; |
| | | |
| | | //升星限制 和改用道具 |
| | | [SerializeField] Text starLimitText; |
| | | |
| | | //升星和合成有进度条 |
| | | [SerializeField] Transform processRect; |
| | | [SerializeField] Image processImg; |
| | | [SerializeField] Text processText; |
| | | [SerializeField] Image fullProcessImg; |
| | | |
| | | //合成部分 |
| | | [SerializeField] Button composeBtn; |
| | | [SerializeField] Image composeBGImg; |
| | | |
| | | |
| | | |
| | | int gubaoID = 0; |
| | | int tabIndex = 0; //0 合成 1 升级 2 升星 |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | seeSuiteBtn.AddListener(() => |
| | | { |
| | | GubaoManager.Instance.ShowTip(gubaoID, 3); |
| | | }); |
| | | |
| | | seeFullBtn.AddListener(() => |
| | | { |
| | | GubaoManager.Instance.ShowTip(gubaoID, 2); |
| | | }); |
| | | lvupTabBtn.AddListener(() => |
| | | { |
| | | tabIndex = 1; |
| | | Display(); |
| | | }); |
| | | starupTabBtn.AddListener(() => |
| | | { |
| | | tabIndex = 2; |
| | | Display(); |
| | | }); |
| | | lvupBtn.AddListener(LVUp); |
| | | starupBtn.AddListener(StarUp); |
| | | composeBtn.AddListener(Compose); |
| | | } |
| | | protected override void OnPreOpen() |
| | | { |
| | | GubaoManager.Instance.UpdateGubaoEvent += UpdateGubaoEvent; |
| | | gubaoID = functionOrder; |
| | | //升星和升级入口对应,全部入口根据状态 |
| | | tabIndex = GubaoManager.Instance.selectTagIndex; |
| | | RefreshTabIndex(); |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | GubaoManager.Instance.UpdateGubaoEvent -= UpdateGubaoEvent; |
| | | } |
| | | |
| | | void UpdateGubaoEvent() |
| | | { |
| | | RefreshTabIndex(); |
| | | Display(); |
| | | } |
| | | |
| | | public void Display() |
| | | { |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | var quality = config.GubaoQuality; |
| | | |
| | | gbImg.SetOrgSprite(config.Icon, "gbicon"); |
| | | gbImg.SetNativeSize(); |
| | | gbBGImg.SetSprite($"GubaoBG{quality}"); |
| | | |
| | | var gbData = GubaoManager.Instance.TryGetGubaoInfo(gubaoID); |
| | | int lv = 0; |
| | | int star = 0; |
| | | int layer = 0; |
| | | if (gbData != null) |
| | | { |
| | | lv = gbData.GubaoLV; |
| | | star = gbData.GubaoStar; |
| | | layer = gbData.EffLayer; |
| | | gbImg.gray = false; |
| | | for (int i = 0; i < starImgs.Length; i++) |
| | | { |
| | | if (i < star) |
| | | { |
| | | starImgs[i].SetActive(true); |
| | | //循环不同图 |
| | | int starIndex = star / starImgs.Length * starImgs.Length + i + 1; |
| | | if (starIndex > star) |
| | | { |
| | | starIndex -= starImgs.Length; |
| | | } |
| | | starImgs[i].SetSprite($"GubaoStar{starIndex}"); |
| | | } |
| | | else |
| | | { |
| | | starImgs[i].SetActive(false); |
| | | } |
| | | } |
| | | processRect.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | gbImg.gray = true; |
| | | for (int i = 0; i < starImgs.Length; i++) |
| | | { |
| | | starImgs[i].SetActive(false); |
| | | } |
| | | } |
| | | gbBGEffect.PlayByArrIndex(quality - 2); |
| | | gbEffect.PlayByArrIndex(quality - 2); |
| | | nameText.text = config.Name; |
| | | nameText.color = UIHelper.GetFuncQualityColor(quality); |
| | | lvText.text = lv == 0 ? "" : Language.Get("L1113", lv); |
| | | |
| | | descText.text = config.Desc; |
| | | var itemConfig = ItemConfig.Get(config.UnlockItemID); |
| | | if (itemConfig.GetWay.IsNullOrEmpty()) |
| | | { |
| | | wayText.text = ""; |
| | | } |
| | | else |
| | | { |
| | | wayText.text = Language.Get("PhantasmPavilion06", GetItemWaysConfig.Get(itemConfig.GetWay[0]).Name); |
| | | } |
| | | ShowAttr(config, layer, lv, star); |
| | | |
| | | if (tabIndex == 0) |
| | | { |
| | | composeBGImg.SetActive(true); |
| | | lvStarBGImg.SetActive(false); |
| | | opBtns.SetActive(false); |
| | | composeBtn.SetActive(true); |
| | | |
| | | processRect.SetActive(true); |
| | | var cnt = VirtualPackManager.Instance.GetNoPackItemCount(config.UnlockItemID); |
| | | float value = cnt * 1.0f / config.UnlockItemCnt; |
| | | processImg.fillAmount = value; |
| | | fullProcessImg.SetActive(value >= 1); |
| | | processText.text = $"{cnt}/{config.UnlockItemCnt}"; |
| | | itemCntText.SetActive(false); |
| | | |
| | | starupBtn.SetActive(false); |
| | | lvupBtn.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | composeBGImg.SetActive(false); |
| | | composeBtn.SetActive(false); |
| | | lvStarBGImg.SetActive(true); |
| | | opBtns.SetActive(true); |
| | | bool isAwake = false; |
| | | var starConfig = GubaoStarConfig.GetConfig(config.GubaoQuality, gbData.GubaoStar + 1); |
| | | if (starConfig != null && !starConfig.Condition.IsNullOrEmpty()) |
| | | { |
| | | isAwake = true; |
| | | } |
| | | |
| | | |
| | | starUpTabNameText.text = !isAwake ? Language.Get("Gubao7") : Language.Get("herocard41"); |
| | | lvupRedImg.SetActive(GubaoManager.Instance.CanLVUpGubao(gubaoID)); |
| | | starupRedImg.SetActive(GubaoManager.Instance.CanStarUpGubao(gubaoID)); |
| | | |
| | | if (tabIndex == 1) |
| | | { |
| | | if (GubaoManager.Instance.IsMaxLV(gubaoID)) |
| | | { |
| | | fullRect.SetActive(true); |
| | | fullLVStarText.text = Language.Get("L1055"); |
| | | lvupBtn.SetActive(false); |
| | | itemCntText.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | fullRect.SetActive(false); |
| | | lvupBtn.SetActive(true); |
| | | var lvUseCfg = GubaoLVConfig.GetConfig(quality, lv); |
| | | int itemID = lvUseCfg.LVUPNeedItemInfo[0][0]; |
| | | itemIconImg.SetItemSprite(itemID); |
| | | itemCntText.text = UIHelper.ShowUseItem(PackType.Item, itemID, lvUseCfg.LVUPNeedItemInfo[0][1]); |
| | | itemCntText.SetActive(true); |
| | | } |
| | | starupBtn.SetActive(false); |
| | | processRect.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | lvupBtn.SetActive(false); |
| | | starUpNameText.text = !isAwake ? Language.Get("Gubao7") : Language.Get("herocard41"); |
| | | if (GubaoManager.Instance.IsMaxStar(gubaoID)) |
| | | { |
| | | fullRect.SetActive(true); |
| | | fullLVStarText.text = Language.Get("HeroGift7"); |
| | | starupBtn.SetActive(false); |
| | | itemCntText.SetActive(false); |
| | | processRect.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | fullRect.SetActive(false); |
| | | starupBtn.SetActive(true); |
| | | if (starConfig.StarUPNeedSelfCnt > 0) |
| | | { |
| | | itemCntText.SetActive(false); |
| | | processRect.SetActive(true); |
| | | var cnt = VirtualPackManager.Instance.GetNoPackItemCount(config.UnlockItemID); |
| | | float value = cnt * 1.0f / starConfig.StarUPNeedSelfCnt; |
| | | processImg.fillAmount = value; |
| | | fullProcessImg.SetActive(value >= 1); |
| | | processText.text = $"{cnt}/{starConfig.StarUPNeedSelfCnt}"; |
| | | } |
| | | else |
| | | { |
| | | processRect.SetActive(false); |
| | | itemCntText.SetActive(true); |
| | | int itemID = starConfig.StarUPNeedItemList[0][0]; |
| | | itemIconImg.SetItemSprite(itemID); |
| | | itemCntText.text = UIHelper.ShowUseItem(PackType.Item, itemID, starConfig.StarUPNeedItemList[0][1]); |
| | | itemCntText.SetActive(true); |
| | | } |
| | | |
| | | if (starConfig.Condition.IsNullOrEmpty()) |
| | | { |
| | | starLimitText.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | starLimitText.SetActive(true); |
| | | int cnt = GubaoManager.Instance.GetGubaoCntByStar(quality, starConfig.Condition[1]); |
| | | string cntInfo = UIHelper.AppendColor(cnt < starConfig.Condition[0] ? TextColType.Red : TextColType.Green, cnt + "/" + starConfig.Condition[0]); |
| | | //需要{0}星{1}:{2} |
| | | starLimitText.text = Language.Get("Gubao20", starConfig.Condition[1], Language.Get($"GubaoTypeName{quality}"), cntInfo); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | //合成会变化成升级 |
| | | void RefreshTabIndex() |
| | | { |
| | | if (tabIndex == 0) |
| | | { |
| | | if (GubaoManager.Instance.IsActive(gubaoID)) |
| | | { |
| | | if (GubaoManager.Instance.CanLVUpGubao(gubaoID)) |
| | | { |
| | | tabIndex = 1; |
| | | lvupTabBtn.SelectBtn(); |
| | | } |
| | | else if (GubaoManager.Instance.CanStarUpGubao(gubaoID)) |
| | | { |
| | | tabIndex = 2; |
| | | starupTabBtn.SelectBtn(); |
| | | } |
| | | else |
| | | { |
| | | tabIndex = 1; |
| | | lvupTabBtn.SelectBtn(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | tabIndex = 0; |
| | | } |
| | | } |
| | | else if (tabIndex == 1) |
| | | { |
| | | lvupTabBtn.SelectBtn(); |
| | | } |
| | | else if (tabIndex == 2) |
| | | { |
| | | starupTabBtn.SelectBtn(); |
| | | } |
| | | } |
| | | |
| | | void ShowAttr(GubaoConfig config, int layer, int lv, int star) |
| | | { |
| | | //基础属性 |
| | | var attrDict = GubaoManager.Instance.GetBaseAttrByGBID(gubaoID, true); |
| | | for (int i = 0; i < attrBaseRects.Length; i++) |
| | | { |
| | | if (i < config.BaseAttrIDList.Length) |
| | | { |
| | | attrBaseRects[i].SetActive(true); |
| | | attrBaseTexts[i].text = PlayerPropertyConfig.GetFullDescription(config.BaseAttrIDList[i], attrDict[config.BaseAttrIDList[i]]); |
| | | if (tabIndex != 2) |
| | | { |
| | | //只有升星有加成 |
| | | addAttrBaseRects[i].SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | //满星也不显示 |
| | | if (GubaoManager.Instance.IsMaxStar(gubaoID)) |
| | | { |
| | | addAttrBaseRects[i].SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | addAttrBaseRects[i].SetActive(true); |
| | | addAttrBaseTexts[i].text = PlayerPropertyConfig.GetValueDescriptionFormat(config.BaseAttrIDList[i], attrDict[config.BaseAttrIDList[i]] + config.BaseAttrPerStarAddList[i]); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | attrBaseRects[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | //特殊属性:只有一个属性,第一行单层属性,第二行为特效效果层级加成汇总 |
| | | attrSpecialRects[1].SetActive(config.SpecEffType != 0); |
| | | //分两种情况 |
| | | //无任何效果的正常升星升级显示第一行,第二行隐藏 |
| | | //有特殊层级的:如果为0,则第一行只显示单行的属性和提升,第二行显示数值0;如果不为0,则第一行显示单行属性和提升,第二行显示数值 |
| | | //有特权效果的亦同 |
| | | var specAttrDict = GubaoManager.Instance.GetSpecialAttrByGBID(gubaoID, true); |
| | | if (config.SpecEffType == 0) |
| | | { |
| | | attrSpecialTexts[0].text = PlayerPropertyConfig.GetFullDescription(config.SpecAttrID, specAttrDict[config.SpecAttrID]); |
| | | if (tabIndex == 0) |
| | | { |
| | | //合成时不显示 |
| | | addAttrSpecialRects[0].SetActive(false); |
| | | } |
| | | else if (tabIndex == 1) |
| | | { |
| | | //满级不显示 |
| | | if (GubaoManager.Instance.IsMaxLV(gubaoID)) |
| | | { |
| | | addAttrSpecialRects[0].SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | var nextAttrDict = GubaoManager.Instance.GetSpecialAttrSingleLayerByGBID(gubaoID, lv + 1); |
| | | addAttrSpecialRects[0].SetActive(true); |
| | | addAttrSpecialTexts[0].text = PlayerPropertyConfig.GetValueDescriptionFormat(config.SpecAttrID, nextAttrDict[config.SpecAttrID]); |
| | | } |
| | | } |
| | | else if (tabIndex == 2) |
| | | { |
| | | //满星不显示 |
| | | if (GubaoManager.Instance.IsMaxStar(gubaoID)) |
| | | { |
| | | addAttrSpecialRects[0].SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | var nextAttrDict = GubaoManager.Instance.GetSpecialAttrSingleLayerByGBID(gubaoID, 0, star + 1); |
| | | addAttrSpecialRects[0].SetActive(true); |
| | | addAttrSpecialTexts[0].text = PlayerPropertyConfig.GetValueDescriptionFormat(config.SpecAttrID, nextAttrDict[config.SpecAttrID]); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //有特殊效果的 |
| | | var singleLayerAttrDict = GubaoManager.Instance.GetSpecialAttrSingleLayerByGBID(gubaoID); |
| | | attrSpecialTexts[0].text = Language.Get("Gubao22_" + config.SpecEffType) + PlayerPropertyConfig.GetFullDescription(config.SpecAttrID, singleLayerAttrDict[config.SpecAttrID]); |
| | | attrSpecialTexts[1].text = Language.Get("Gubao21", layer, config.SpecEffLayerMax, PlayerPropertyConfig.GetFullDescription(config.SpecAttrID, layer == 0 ? 0 : specAttrDict[config.SpecAttrID])); |
| | | if (tabIndex == 0) |
| | | { |
| | | //合成时不显示 |
| | | addAttrSpecialRects[0].SetActive(false); |
| | | addAttrSpecialRects[1].SetActive(false); |
| | | } |
| | | else if (tabIndex == 1) |
| | | { |
| | | //满级不显示 |
| | | if (GubaoManager.Instance.IsMaxLV(gubaoID)) |
| | | { |
| | | addAttrSpecialRects[0].SetActive(false); |
| | | addAttrSpecialRects[1].SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | var nextAttrDict = GubaoManager.Instance.GetSpecialAttrSingleLayerByGBID(gubaoID, lv + 1); |
| | | addAttrSpecialRects[0].SetActive(true); |
| | | addAttrSpecialTexts[0].text = PlayerPropertyConfig.GetValueDescriptionFormat(config.SpecAttrID, nextAttrDict[config.SpecAttrID]); |
| | | addAttrSpecialRects[1].SetActive(true); |
| | | addAttrSpecialTexts[1].text = PlayerPropertyConfig.GetValueDescriptionFormat(config.SpecAttrID, nextAttrDict[config.SpecAttrID] * layer); |
| | | } |
| | | } |
| | | else if (tabIndex == 2) |
| | | { |
| | | //满星不显示 |
| | | if (GubaoManager.Instance.IsMaxStar(gubaoID)) |
| | | { |
| | | addAttrSpecialRects[0].SetActive(false); |
| | | addAttrSpecialRects[1].SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | var nextAttrDict = GubaoManager.Instance.GetSpecialAttrSingleLayerByGBID(gubaoID, 0, star + 1); |
| | | addAttrSpecialRects[0].SetActive(true); |
| | | addAttrSpecialTexts[0].text = PlayerPropertyConfig.GetValueDescriptionFormat(config.SpecAttrID, nextAttrDict[config.SpecAttrID]); |
| | | addAttrSpecialRects[1].SetActive(true); |
| | | addAttrSpecialTexts[1].text = PlayerPropertyConfig.GetValueDescriptionFormat(config.SpecAttrID, nextAttrDict[config.SpecAttrID] * layer); |
| | | } |
| | | } |
| | | } |
| | | if (config.PowerType != 0) |
| | | { |
| | | // 1 游历双倍奖励概率 无 增加万分率 万分率 |
| | | // 2 月卡领取额外奖励 物品ID 提升百分比 百分比 |
| | | |
| | | //有特权效果的 非属性类 |
| | | attrPrivilegeRect.SetActive(true); |
| | | var valueDict = GubaoManager.Instance.GetPrivilegeValueByGBID(gubaoID, true); |
| | | if (config.PowerType == 1) |
| | | { |
| | | attrPrivilegeText.text = Language.Get("Gubao23_" + config.PowerType, valueDict[config.PowerType] / 100.0); |
| | | } |
| | | else if (config.PowerType == 2) |
| | | { |
| | | attrPrivilegeText.text = Language.Get("Gubao23_" + config.PowerType, ItemConfig.Get(config.PowerTypeValue).ItemName, valueDict[config.PowerType]); |
| | | } |
| | | |
| | | if (tabIndex != 2) |
| | | { |
| | | addPrivilegeRect.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | addPrivilegeRect.SetActive(true); |
| | | float addValue = 0f; |
| | | if (config.PowerType == 1) |
| | | { |
| | | addValue = config.PowerPerStarAdd / 100.0f; |
| | | } |
| | | else if (config.PowerType == 2) |
| | | { |
| | | addValue = config.PowerPerStarAdd; |
| | | } |
| | | addPrivilegeText.text = Language.Get("Gubao24", valueDict[config.PowerType] + addValue); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | attrPrivilegeRect.SetActive(false); |
| | | } |
| | | |
| | | } |
| | | |
| | | void StarUp() |
| | | { |
| | | var gbData = GubaoManager.Instance.TryGetGubaoInfo(gubaoID); |
| | | if (gbData == null) |
| | | return; |
| | | |
| | | //提醒需要x星x个古宝 |
| | | var starConfig = GubaoStarConfig.GetConfig(gbData.Quality, gbData.GubaoStar + 1); |
| | | if (!starConfig.Condition.IsNullOrEmpty() && GubaoManager.Instance.GetGubaoCntByStar(gbData.Quality, starConfig.Condition[1]) < starConfig.Condition[0]) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("GubaoStar", starConfig.Condition[0], starConfig.Condition[1], Language.Get($"GubaoTypeName{gbData.Quality}")); |
| | | return; |
| | | } |
| | | |
| | | if (starConfig.StarUPNeedSelfCnt > 0) |
| | | { |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | if (VirtualPackManager.Instance.GetNoPackItemCount(config.UnlockItemID) < starConfig.StarUPNeedSelfCnt) |
| | | { |
| | | ItemTipUtility.Show(config.UnlockItemID, true); |
| | | return; |
| | | } |
| | | } |
| | | if (starConfig.StarUPNeedItemList.Length > 0) |
| | | { |
| | | if (PackManager.Instance.GetItemCountByID(PackType.Item, starConfig.StarUPNeedItemList[0][0]) < starConfig.StarUPNeedItemList[0][1]) |
| | | { |
| | | ItemTipUtility.Show(starConfig.StarUPNeedItemList[0][0], true); |
| | | return; |
| | | } |
| | | } |
| | | starupEffect.Play(); |
| | | GubaoManager.Instance.UpgradeGubaoStar(gubaoID); |
| | | |
| | | } |
| | | |
| | | void LVUp() |
| | | { |
| | | var gbData = GubaoManager.Instance.TryGetGubaoInfo(gubaoID); |
| | | if (gbData == null) |
| | | return; |
| | | |
| | | var lvConfig = GubaoLVConfig.GetConfig(gbData.Quality, gbData.GubaoLV); |
| | | |
| | | //检查材料 |
| | | if (PackManager.Instance.GetItemCountByID(PackType.Item, lvConfig.LVUPNeedItemInfo[0][0]) < lvConfig.LVUPNeedItemInfo[0][1]) |
| | | { |
| | | ItemTipUtility.Show(lvConfig.LVUPNeedItemInfo[0][0], true); |
| | | return; |
| | | } |
| | | |
| | | lvupEffect.Play(); |
| | | GubaoManager.Instance.UpgradeGubaoLV(gubaoID); |
| | | } |
| | | |
| | | void Compose() |
| | | { |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | if (VirtualPackManager.Instance.GetNoPackItemCount(config.UnlockItemID) < config.UnlockItemCnt) |
| | | { |
| | | ItemTipUtility.Show(config.UnlockItemID, true); |
| | | return; |
| | | } |
| | | |
| | | GubaoManager.Instance.ActiveGubao(gubaoID); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: db6d6b2a988ad0a4f93543482340a23c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class GubaoListCell : CellView |
| | | { |
| | | [SerializeField] GubaoCell[] gubaoCells; |
| | | |
| | | |
| | | public void Display(int index) |
| | | { |
| | | var quality = index / 100000; |
| | | var startIndex = index % 100000; |
| | | var allCnt = GubaoManager.Instance.gubaoCollectDict[quality].Count; |
| | | for (int i = 0; i < gubaoCells.Length; i++) |
| | | { |
| | | if (startIndex + i < allCnt) |
| | | { |
| | | gubaoCells[i].SetActive(true); |
| | | gubaoCells[i].Display(quality, startIndex + i); |
| | | } |
| | | else |
| | | { |
| | | gubaoCells[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 21573adcd53524f4c93c9919e9a073a2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class GubaoListNameCell : CellView |
| | | { |
| | | [SerializeField] Text nameText; |
| | | |
| | | |
| | | public void Display(int quality) |
| | | { |
| | | nameText.text = Language.Get($"GubaoTypeName{quality}") + |
| | | Language.Get("HeroFates11", GubaoManager.Instance.GetActiveCnt(quality), GubaoManager.Instance.gubaoCollectDict[quality].Count); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 41792f1bb891437429dd1ec9731cfa32 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 古宝列表 |
| | | /// </summary> |
| | | public class GubaoListWin : UIBase |
| | | { |
| | | [SerializeField] GroupButtonEx allBtn; |
| | | [SerializeField] GroupButtonEx lvupBtn; |
| | | [SerializeField] GroupButtonEx starBtn; |
| | | [SerializeField] Button seeAttrBtn; |
| | | [SerializeField] ScrollerController scroller; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | allBtn.AddListener(() => |
| | | { |
| | | GubaoManager.Instance.selectTagIndex = 0; |
| | | }); |
| | | lvupBtn.AddListener(() => |
| | | { |
| | | GubaoManager.Instance.selectTagIndex = 1; |
| | | }); |
| | | starBtn.AddListener(() => |
| | | { |
| | | GubaoManager.Instance.selectTagIndex = 2; |
| | | }); |
| | | seeAttrBtn.AddListener(() => |
| | | { |
| | | AttributeManager.Instance.OpenTotalAttributeWin(BeautyMMManager.Instance.allMMTalentAttr); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | GubaoManager.Instance.selectTagIndex = 0; |
| | | GubaoManager.Instance.SortGubaoList(); |
| | | GubaoManager.Instance.OnSelectUpdate += OnSelectUpdate; |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | UIManager.Instance.OnCloseWindow += OnCloseWindow; |
| | | allBtn.SelectBtn(); |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | GubaoManager.Instance.OnSelectUpdate -= OnSelectUpdate; |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | UIManager.Instance.OnCloseWindow -= OnCloseWindow; |
| | | } |
| | | |
| | | void OnCloseWindow(UIBase ui) |
| | | { |
| | | if (ui is GubaoDetailWin) |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | } |
| | | |
| | | void OnSelectUpdate() |
| | | { |
| | | GubaoManager.Instance.SortGubaoList(); |
| | | Display(); |
| | | } |
| | | |
| | | void Display() |
| | | { |
| | | scroller.Refresh(); |
| | | var keys = GubaoManager.Instance.gubaoCollectDict.Keys.ToList(); |
| | | keys.OrderByDescending(x => x); |
| | | int jumpIndex = 0; |
| | | int activeIndex = -1; //可激活需要跳转 |
| | | for (int i = 0; i < keys.Count; i++) |
| | | { |
| | | var quality = keys[i]; |
| | | scroller.AddCell(ScrollerDataType.Header, quality); |
| | | var idList = GubaoManager.Instance.gubaoCollectDict[quality]; |
| | | for (int j = 0; j < idList.Count; j++) |
| | | { |
| | | if (j % 4 == 0) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Normal, quality * 100000 + j); |
| | | jumpIndex++; |
| | | if (activeIndex == -1 && GubaoManager.Instance.CanActiveGubao(idList[j])) |
| | | { |
| | | activeIndex = jumpIndex; |
| | | } |
| | | } |
| | | } |
| | | jumpIndex++; |
| | | } |
| | | |
| | | scroller.Restart(); |
| | | if (GubaoManager.Instance.selectTagIndex == 0) |
| | | { |
| | | //跳转红点 |
| | | scroller.JumpIndex(activeIndex); |
| | | } |
| | | } |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | if (type == ScrollerDataType.Header) |
| | | { |
| | | var _cell = cell as GubaoListNameCell; |
| | | _cell.Display(cell.index); |
| | | } |
| | | else if (type == ScrollerDataType.Normal) |
| | | { |
| | | var _cell = cell as GubaoListCell; |
| | | _cell.Display(cell.index); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7118eabd602fad24b855b87de6849aec |
| | | 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 System; |
| | | using System.Linq; |
| | | using LitJson; |
| | | |
| | | |
| | | public partial class GubaoManager : GameSystemManager<GubaoManager> |
| | | { |
| | | //古宝ID:[星级,等级, 特殊层] |
| | | Dictionary<int, GubaoInfo> gubaoDict = new Dictionary<int, GubaoInfo>(); |
| | | public event Action UpdateGubaoEvent; |
| | | public int waitActiveGubao; |
| | | public int selectGubao; //从藏宝阁选中 |
| | | |
| | | int m_SelectTagIndex = 0; //古宝Tag类型 0 全部 1 可升级 2 可升星 |
| | | public event Action OnSelectUpdate; |
| | | public int selectTagIndex |
| | | { |
| | | get { return m_SelectTagIndex; } |
| | | set |
| | | { |
| | | if (m_SelectTagIndex != value) |
| | | { |
| | | m_SelectTagIndex = value; |
| | | OnSelectUpdate?.Invoke(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //按 全部 升级 升星 区分 |
| | | public Dictionary<int, List<int>> gubaoCollectDict = new Dictionary<int, List<int>>(); //古宝图鉴按品质列表 |
| | | |
| | | |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitialize; |
| | | PackManager.Instance.RefreshItemEvent += RefreshItemCount; |
| | | VirtualPackManager.Instance.OnNoPackItemCountRefresh += UpdateRedpoint; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOK; |
| | | ParseConfig(); |
| | | |
| | | |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitialize; |
| | | PackManager.Instance.RefreshItemEvent -= RefreshItemCount; |
| | | VirtualPackManager.Instance.OnNoPackItemCountRefresh -= UpdateRedpoint; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOK; |
| | | } |
| | | |
| | | void ParseConfig() |
| | | { |
| | | } |
| | | |
| | | |
| | | void OnBeforePlayerDataInitialize() |
| | | { |
| | | gubaoDict.Clear(); |
| | | waitActiveGubao = 0; |
| | | } |
| | | |
| | | void OnPlayerLoginOK() |
| | | { |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | void RefreshItemCount(PackType packType, int index, int itemID) |
| | | { |
| | | if (packType == PackType.Item) |
| | | { |
| | | if (CanRefreshRepoint(itemID)) |
| | | { |
| | | UpdateRedpoint(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //物品刷新 |
| | | bool CanRefreshRepoint(int itemID) |
| | | { |
| | | |
| | | if (GubaoLVConfig.useItemIDS.Contains(itemID)) |
| | | return true; |
| | | |
| | | if (GubaoStarConfig.useItemIDS.Contains(itemID)) |
| | | return true; |
| | | return false; |
| | | } |
| | | |
| | | public void UpdateGubaoNetPack(HA3C7_tagMCGubaoInfo netPack) |
| | | { |
| | | |
| | | for (int i = 0; i < netPack.Count; i++) |
| | | { |
| | | gubaoDict[netPack.GubaoInfoList[i].GubaoID] = new GubaoInfo() |
| | | { |
| | | GubaoStar = netPack.GubaoInfoList[i].GubaoStar, |
| | | GubaoLV = netPack.GubaoInfoList[i].GubaoLV, |
| | | EffLayer = netPack.GubaoInfoList[i].EffLayer, |
| | | Quality = GubaoConfig.Get(netPack.GubaoInfoList[i].GubaoID).GubaoQuality |
| | | }; |
| | | } |
| | | |
| | | UpdateGubaoEvent?.Invoke(); |
| | | if (DTC0403_tagPlayerLoginLoadOK.finishedLogin && waitActiveGubao != 0 && gubaoDict.ContainsKey(waitActiveGubao)) |
| | | { |
| | | UIManager.Instance.OpenWindow<GubaoActiveWin>(waitActiveGubao); |
| | | waitActiveGubao = 0; |
| | | } |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | |
| | | |
| | | public GubaoInfo TryGetGubaoInfo(int gubaoID) |
| | | { |
| | | if (!gubaoDict.ContainsKey(gubaoID)) |
| | | return null; |
| | | |
| | | return gubaoDict[gubaoID]; |
| | | } |
| | | |
| | | // 按选择排序 m_SelectTagIndex 可合成 ,已合成,未合成 |
| | | public void SortGubaoList() |
| | | { |
| | | gubaoCollectDict.Clear(); |
| | | if (m_SelectTagIndex == 0) |
| | | { |
| | | var keys = GubaoConfig.GetKeys(); |
| | | foreach (var key in keys) |
| | | { |
| | | var config = GubaoConfig.Get(key); |
| | | if (!gubaoCollectDict.ContainsKey(config.GubaoQuality)) |
| | | { |
| | | gubaoCollectDict[config.GubaoQuality] = new List<int>(); |
| | | } |
| | | gubaoCollectDict[config.GubaoQuality].Add(key); |
| | | } |
| | | } |
| | | else if (m_SelectTagIndex == 1) |
| | | { |
| | | //可升级 |
| | | foreach (var gubao in gubaoDict.Keys) |
| | | { |
| | | var quality = gubaoDict[gubao].Quality; |
| | | if (!CanLVUpGubao(gubao)) |
| | | { |
| | | continue; |
| | | } |
| | | if (!gubaoCollectDict.ContainsKey(quality)) |
| | | { |
| | | gubaoCollectDict[quality] = new List<int>(); |
| | | } |
| | | gubaoCollectDict[quality].Add(gubao); |
| | | } |
| | | } |
| | | else if (m_SelectTagIndex == 2) |
| | | { |
| | | //可升星 |
| | | foreach (var gubao in gubaoDict.Keys) |
| | | { |
| | | var quality = gubaoDict[gubao].Quality; |
| | | if (!CanStarUpGubao(gubao)) |
| | | { |
| | | continue; |
| | | } |
| | | if (!gubaoCollectDict.ContainsKey(quality)) |
| | | { |
| | | gubaoCollectDict[quality] = new List<int>(); |
| | | } |
| | | gubaoCollectDict[quality].Add(gubao); |
| | | } |
| | | } |
| | | |
| | | |
| | | foreach (var idList in gubaoCollectDict.Values) |
| | | { |
| | | idList.Sort(CmpGubao); |
| | | } |
| | | } |
| | | |
| | | //排序显示 可激活-已激活 - ID |
| | | int CmpGubao(int gubaoA, int gubaoB) |
| | | { |
| | | var isActiveA = gubaoDict.ContainsKey(gubaoA); |
| | | var isActiveB = gubaoDict.ContainsKey(gubaoB); |
| | | |
| | | var configA = GubaoConfig.Get(gubaoA); |
| | | var configB = GubaoConfig.Get(gubaoB); |
| | | var canActiveA = false; |
| | | var canActiveB = false; |
| | | if (!isActiveA) |
| | | { |
| | | canActiveA = VirtualPackManager.Instance.GetNoPackItemCount(configA.UnlockItemID) >= configA.UnlockItemCnt; |
| | | } |
| | | |
| | | if (!isActiveB) |
| | | { |
| | | canActiveB = VirtualPackManager.Instance.GetNoPackItemCount(configB.UnlockItemID) >= configB.UnlockItemCnt; |
| | | } |
| | | |
| | | if (canActiveA != canActiveB) |
| | | { |
| | | return canActiveB.CompareTo(canActiveA); |
| | | } |
| | | |
| | | if (isActiveA != isActiveB) |
| | | { |
| | | return isActiveB.CompareTo(isActiveA); |
| | | } |
| | | |
| | | |
| | | return gubaoA.CompareTo(gubaoB); |
| | | } |
| | | |
| | | public int GetActiveCnt(int gubaoQuality) |
| | | { |
| | | int cnt = 0; |
| | | foreach (var gubao in gubaoDict.Keys) |
| | | { |
| | | if (GubaoConfig.Get(gubao).GubaoQuality == gubaoQuality) |
| | | { |
| | | cnt++; |
| | | } |
| | | } |
| | | return cnt; |
| | | } |
| | | |
| | | public void ActiveGubao(int gubaoID) |
| | | { |
| | | var pak = new CB216_tagCMGubaoActivate(); |
| | | pak.GubaoID = (ushort)gubaoID; |
| | | GameNetSystem.Instance.SendInfo(pak); |
| | | waitActiveGubao = gubaoID; |
| | | } |
| | | |
| | | public void UpgradeGubaoStar(int gubaoID) |
| | | { |
| | | var pak = new CB217_tagCMGubaoStarUp(); |
| | | pak.GubaoID = (ushort)gubaoID; |
| | | GameNetSystem.Instance.SendInfo(pak); |
| | | waitActiveGubao = 0; |
| | | } |
| | | |
| | | public void UpgradeGubaoLV(int gubaoID) |
| | | { |
| | | var pak = new CB218_tagCMGubaoLVUp(); |
| | | pak.GubaoID = (ushort)gubaoID; |
| | | GameNetSystem.Instance.SendInfo(pak); |
| | | waitActiveGubao = 0; |
| | | } |
| | | |
| | | public bool IsActive(int gubaoID) |
| | | { |
| | | return gubaoDict.ContainsKey(gubaoID); |
| | | } |
| | | |
| | | public bool CanActiveGubao(int gubaoID) |
| | | { |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | if (gubaoInfo != null) |
| | | return false; |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | |
| | | return VirtualPackManager.Instance.GetNoPackItemCount(config.UnlockItemID) >= config.UnlockItemCnt; |
| | | } |
| | | |
| | | //获取同品质的古宝数量且达到X星 |
| | | public int GetGubaoCntByStar(int gubaoQuality, int gubaoStar) |
| | | { |
| | | int cnt = 0; |
| | | foreach (var gubaoInfo in gubaoDict.Values) |
| | | { |
| | | if (gubaoInfo.Quality == gubaoQuality && gubaoInfo.GubaoStar >= gubaoStar) |
| | | { |
| | | cnt++; |
| | | } |
| | | } |
| | | return cnt; |
| | | } |
| | | |
| | | public bool CanStarUpGubao(int gubaoID) |
| | | { |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | if (gubaoInfo == null) |
| | | { |
| | | return false; |
| | | } |
| | | //判断消耗 |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | var starConfig = GubaoStarConfig.GetConfig(config.GubaoQuality, gubaoInfo.GubaoStar + 1); |
| | | if (starConfig == null) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | //判断同品质的古宝数量且达到X星 |
| | | if (!starConfig.Condition.IsNullOrEmpty()) |
| | | { |
| | | if (GetGubaoCntByStar(config.GubaoQuality, starConfig.Condition[1]) < starConfig.Condition[0]) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | if (starConfig.StarUPNeedSelfCnt > 0 && |
| | | VirtualPackManager.Instance.GetNoPackItemCount(config.UnlockItemID) < starConfig.StarUPNeedSelfCnt) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | for (int i = 0; i < starConfig.StarUPNeedItemList.Length; i++) |
| | | { |
| | | if (PackManager.Instance.GetItemCountByID(PackType.Item, starConfig.StarUPNeedItemList[i][0]) < starConfig.StarUPNeedItemList[i][1]) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | |
| | | } |
| | | |
| | | public bool CanLVUpGubao(int gubaoID) |
| | | { |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | if (gubaoInfo == null) |
| | | { |
| | | return false; |
| | | } |
| | | //判断消耗 |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | var lvConfig = GubaoLVConfig.GetConfig(config.GubaoQuality, gubaoInfo.GubaoLV); |
| | | if (lvConfig == null) |
| | | { |
| | | return false; |
| | | } |
| | | for (int i = 0; i < lvConfig.LVUPNeedItemInfo.Length; i++) |
| | | { |
| | | if (PackManager.Instance.GetItemCountByID(PackType.Item, lvConfig.LVUPNeedItemInfo[i][0]) < lvConfig.LVUPNeedItemInfo[i][1]) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | //是否有红点 |
| | | public bool IsRedTip(int gubaoID) |
| | | { |
| | | if (selectTagIndex == 0 && CanActiveGubao(gubaoID)) |
| | | { |
| | | return true; |
| | | } |
| | | if (selectTagIndex == 2 && CanStarUpGubao(gubaoID)) |
| | | { |
| | | return true; |
| | | } |
| | | if (selectTagIndex == 1 && CanLVUpGubao(gubaoID)) |
| | | { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public int tipType = 0; // 0完整tip(可切满级) 1 只有基础满级不可切换 2 只有套装 |
| | | public void ShowTip(int gubaoID, int type) |
| | | { |
| | | tipType = type; |
| | | UIManager.Instance.OpenWindow<GubaoTipWin>(gubaoID); |
| | | } |
| | | |
| | | |
| | | #region 属性 |
| | | |
| | | public Dictionary<int, long> GetBaseAttrByGBID(int gubaoID, bool isPreview = false) |
| | | { |
| | | Dictionary<int, long> attrDict = new Dictionary<int, long>(); |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | if (gubaoInfo == null) |
| | | { |
| | | if (isPreview) |
| | | { |
| | | for (int i = 0; i < config.BaseAttrIDList.Length; i++) |
| | | { |
| | | attrDict[config.BaseAttrIDList[i]] = config.BaseAttrValueList[i]; |
| | | } |
| | | } |
| | | |
| | | return attrDict; |
| | | } |
| | | |
| | | for (int i = 0; i < config.BaseAttrIDList.Length; i++) |
| | | { |
| | | attrDict[config.BaseAttrIDList[i]] = config.BaseAttrValueList[i] + config.BaseAttrPerStarAddList[i] * gubaoInfo.GubaoStar; |
| | | } |
| | | return attrDict; |
| | | } |
| | | |
| | | public Dictionary<int, long> GetSpecialAttrByGBID(int gubaoID, bool isPreview = false) |
| | | { |
| | | Dictionary<int, long> attrDict = new Dictionary<int, long>(); |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | if (gubaoInfo == null) |
| | | { |
| | | if (isPreview) |
| | | { |
| | | //特殊属性激活属性 = 初始属性 + 1级的特殊属性 |
| | | attrDict[config.SpecAttrID] = config.SpecAttrValue + GubaoLVAttrConfig.GetSpecLVAttrValue(config.GubaoQuality, 1, config.SpecAttrID); |
| | | } |
| | | return attrDict; |
| | | } |
| | | |
| | | attrDict[config.SpecAttrID] = config.SpecAttrValue + config.SpecAttrPerStarAdd * gubaoInfo.GubaoStar |
| | | + GubaoLVAttrConfig.GetSpecLVAttrValue(gubaoInfo.Quality, gubaoInfo.GubaoLV, config.SpecAttrID); |
| | | |
| | | if (config.SpecEffType != 0) |
| | | { |
| | | //服务端记录 |
| | | attrDict[config.SpecAttrID] *= gubaoInfo.EffLayer; |
| | | } |
| | | |
| | | return attrDict; |
| | | } |
| | | |
| | | |
| | | |
| | | //单层的属性,或者不需要层的 |
| | | public Dictionary<int, long> GetSpecialAttrSingleLayerByGBID(int gubaoID, int lv = 0, int star = 0) |
| | | { |
| | | Dictionary<int, long> attrDict = new Dictionary<int, long>(); |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | if (gubaoInfo == null) |
| | | { |
| | | //特殊属性激活属性 = 初始属性 + 1级的特殊属性 |
| | | attrDict[config.SpecAttrID] = config.SpecAttrValue + GubaoLVAttrConfig.GetSpecLVAttrValue(config.GubaoQuality, 1, config.SpecAttrID); |
| | | return attrDict; |
| | | } |
| | | |
| | | if (lv == 0) |
| | | { |
| | | lv = gubaoInfo.GubaoLV; |
| | | } |
| | | if (star == 0) |
| | | { |
| | | star = gubaoInfo.GubaoStar; |
| | | } |
| | | |
| | | attrDict[config.SpecAttrID] = config.SpecAttrValue + config.SpecAttrPerStarAdd * star |
| | | + GubaoLVAttrConfig.GetSpecLVAttrValue(gubaoInfo.Quality, lv, config.SpecAttrID); |
| | | |
| | | return attrDict; |
| | | } |
| | | |
| | | //获取特权值 |
| | | public Dictionary<int, int> GetPrivilegeValueByGBID(int gubaoID, bool isPreview = false) |
| | | { |
| | | Dictionary<int, int> attrDict = new Dictionary<int, int>(); |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | if (gubaoInfo == null) |
| | | { |
| | | if (isPreview) |
| | | { |
| | | attrDict[config.PowerType] = config.PowerValue; |
| | | } |
| | | return attrDict; |
| | | } |
| | | |
| | | attrDict[config.PowerType] = config.PowerValue + config.PowerPerStarAdd * gubaoInfo.GubaoStar; |
| | | return attrDict; |
| | | } |
| | | |
| | | public bool IsMaxLV(int gubaoID) |
| | | { |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | if (gubaoInfo == null) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return gubaoInfo.GubaoLV >= GubaoLVAttrConfig.GetMaxLV(gubaoInfo.Quality); |
| | | } |
| | | |
| | | public bool IsMaxStar(int gubaoID) |
| | | { |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | if (gubaoInfo == null) |
| | | { |
| | | return false; |
| | | } |
| | | return gubaoInfo.GubaoStar >= GubaoStarConfig.GetMaxStar(config.GubaoQuality); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 红点 |
| | | Redpoint tmpRP = new Redpoint(MainRedDot.MainAffairsRedpoint, MainRedDot.RedPoint_GuaBao); |
| | | Redpoint gubaoRP = new Redpoint(MainRedDot.RedPoint_GuaBao, MainRedDot.RedPoint_GuaBao * 10 + 1); //古宝 和 全部 |
| | | Redpoint gubaoCallRP = new Redpoint(MainRedDot.RedPoint_GuaBao, MainRedDot.RedPoint_GuaBao * 10 + 2); // 鉴宝 |
| | | Redpoint gubaoSuiteRP = new Redpoint(MainRedDot.RedPoint_GuaBao, MainRedDot.RedPoint_GuaBao * 10 + 3); // 套装 |
| | | Redpoint activeRP = new Redpoint(MainRedDot.RedPoint_GuaBao * 10 + 1, MainRedDot.RedPoint_GuaBao * 100); //可激活 全部 |
| | | Redpoint gubaoLVRP = new Redpoint(MainRedDot.RedPoint_GuaBao * 10 + 1, MainRedDot.RedPoint_GuaBao * 100 + 1); //升级 |
| | | Redpoint gubaoStarRP = new Redpoint(MainRedDot.RedPoint_GuaBao * 10 + 1, MainRedDot.RedPoint_GuaBao * 100 + 2); //升星 |
| | | |
| | | |
| | | public void UpdateRedpoint() |
| | | { |
| | | activeRP.state = RedPointState.None; |
| | | gubaoLVRP.state = RedPointState.None; |
| | | gubaoStarRP.state = RedPointState.None; |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.GuaBao)) |
| | | return; |
| | | |
| | | var keys = GubaoConfig.GetKeys(); |
| | | for (int i = 0; i < keys.Count; i++) |
| | | { |
| | | var gubaoID = keys[i]; |
| | | if (activeRP.state == RedPointState.None && CanActiveGubao(gubaoID)) |
| | | { |
| | | activeRP.state = RedPointState.Simple; |
| | | } |
| | | |
| | | if (gubaoLVRP.state == RedPointState.None && CanLVUpGubao(gubaoID)) |
| | | { |
| | | gubaoLVRP.state = RedPointState.Simple; |
| | | } |
| | | |
| | | if (gubaoStarRP.state == RedPointState.None && CanStarUpGubao(gubaoID)) |
| | | { |
| | | gubaoStarRP.state = RedPointState.Simple; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | |
| | | public class GubaoInfo |
| | | { |
| | | public int GubaoStar; |
| | | public int GubaoLV; |
| | | public int EffLayer; |
| | | public int Quality; |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2b3a37ebb944365409e1f3783771b5c6 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | |
| | | using System.Text; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 古宝TIP |
| | | /// </summary> |
| | | public class GubaoTipWin : UIBase |
| | | { |
| | | [SerializeField] ImageEx gbImg; |
| | | [SerializeField] UIEffectPlayer gbBGEffect; |
| | | [SerializeField] UIEffectPlayer gbEffect; |
| | | [SerializeField] Text nameText; |
| | | //基础属性 |
| | | [SerializeField] Text[] attrBaseTexts; |
| | | [SerializeField] Text attrSpecialText; |
| | | [SerializeField] Transform attrPrivilegeRect; |
| | | [SerializeField] Text attrPrivilegeText; |
| | | |
| | | [SerializeField] Button okBtn; |
| | | |
| | | int gubaoID = 0; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | okBtn.AddListener(CloseWindow); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | gubaoID = functionOrder; |
| | | Display(); |
| | | } |
| | | |
| | | |
| | | public void Display() |
| | | { |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | gbImg.SetOrgSprite(config.Icon, "gbicon"); |
| | | gbImg.SetNativeSize(); |
| | | |
| | | var gbData = GubaoManager.Instance.TryGetGubaoInfo(gubaoID); |
| | | gbBGEffect.PlayByArrIndex(gbData.Quality - 2); |
| | | gbEffect.PlayByArrIndex(gbData.Quality - 2); |
| | | nameText.text = config.Name; |
| | | nameText.color = UIHelper.GetFuncQualityColor(gbData.Quality); |
| | | ShowAttr(config); |
| | | } |
| | | |
| | | void ShowAttr(GubaoConfig config) |
| | | { |
| | | //基础属性 |
| | | var attrDict = GubaoManager.Instance.GetBaseAttrByGBID(gubaoID); |
| | | for (int i = 0; i < attrBaseTexts.Length; i++) |
| | | { |
| | | if (i < config.BaseAttrIDList.Length) |
| | | { |
| | | attrBaseTexts[i].SetActive(true); |
| | | attrBaseTexts[i].text = PlayerPropertyConfig.GetFullDescription(config.BaseAttrIDList[i], attrDict[config.BaseAttrIDList[i]]); |
| | | } |
| | | else |
| | | { |
| | | attrBaseTexts[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | //特殊属性:只有一个属性,第一行单层属性,第二行为特效效果层级加成汇总 |
| | | //分两种情况 |
| | | //无任何效果的正常升星升级显示第一行,第二行隐藏 |
| | | //有特殊层级的:如果为0,则第一行只显示单行的属性和提升,第二行显示数值0;如果不为0,则第一行显示单行属性和提升,第二行显示数值 |
| | | //有特权效果的亦同 |
| | | var specAttrDict = GubaoManager.Instance.GetSpecialAttrByGBID(gubaoID, true); |
| | | if (config.SpecEffType == 0) |
| | | { |
| | | attrSpecialText.text = PlayerPropertyConfig.GetFullDescription(config.SpecAttrID, specAttrDict[config.SpecAttrID]); |
| | | } |
| | | else |
| | | { |
| | | //有特殊效果的 |
| | | var singleLayerAttrDict = GubaoManager.Instance.GetSpecialAttrSingleLayerByGBID(gubaoID); |
| | | attrSpecialText.text = Language.Get("Gubao22_" + config.SpecEffType) + PlayerPropertyConfig.GetFullDescription(config.SpecAttrID, singleLayerAttrDict[config.SpecAttrID]); |
| | | } |
| | | if (config.PowerType != 0) |
| | | { |
| | | // 1 游历双倍奖励概率 无 增加万分率 万分率 |
| | | // 2 月卡领取额外奖励 物品ID 提升百分比 百分比 |
| | | |
| | | //有特权效果的 非属性类 |
| | | attrPrivilegeRect.SetActive(true); |
| | | var valueDict = GubaoManager.Instance.GetPrivilegeValueByGBID(gubaoID, true); |
| | | if (config.PowerType == 1) |
| | | { |
| | | attrPrivilegeText.text = Language.Get("Gubao23_" + config.PowerType, valueDict[config.PowerType] / 100.0); |
| | | } |
| | | else if (config.PowerType == 2) |
| | | { |
| | | attrPrivilegeText.text = Language.Get("Gubao23_" + config.PowerType, ItemConfig.Get(config.PowerTypeValue).ItemName, valueDict[config.PowerType]); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | attrPrivilegeRect.SetActive(false); |
| | | } |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b1c7ee1650690444ab2c53a1ccd0fd4d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | { |
| | | UIManager.Instance.OpenWindow<BeautyMMBaseWin>(); |
| | | } |
| | | else if (funcID == 28) |
| | | { |
| | | UIManager.Instance.OpenWindow<GubaoBaseWin>(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | UIManager.Instance.OpenWindow<ChooseItemsWin>(); |
| | | break; |
| | | case TipType.TreasurePavilion: |
| | | // TreasurePavilionModel.Instance.selectGubao = config.EffectValueA1; |
| | | // TreasurePavilionModel.Instance.showTipFromPiece = config.ID; |
| | | // WindowCenter.Instance.OpenIL<TreasurePavilionTipWin>(); |
| | | UIManager.Instance.OpenWindow<ItemTipWin>(); |
| | | GubaoManager.Instance.ShowTip(itemId, 0); |
| | | break; |
| | | default: |
| | | UIManager.Instance.OpenWindow<ItemTipWin>(); |
| | |
| | | |
| | | public class VirtualPackManager : GameSystemManager<VirtualPackManager> |
| | | { |
| | | Dictionary<PackType, List<VirtualPackItem>> virtualPackItems |
| | | = new Dictionary<PackType, List<VirtualPackItem>>(); |
| | | Dictionary<PackType, ObjectPool<VirtualPackItem>> m_VirtualItemPool |
| | | = new Dictionary<PackType, ObjectPool<VirtualPackItem>>(); |
| | | Dictionary<PackType, int> virtualPackCapacityDict = new Dictionary<PackType, int>(); |
| | | // Dictionary<PackType, List<VirtualPackItem>> virtualPackItems |
| | | // = new Dictionary<PackType, List<VirtualPackItem>>(); |
| | | // Dictionary<PackType, ObjectPool<VirtualPackItem>> m_VirtualItemPool |
| | | // = new Dictionary<PackType, ObjectPool<VirtualPackItem>>(); |
| | | // Dictionary<PackType, int> virtualPackCapacityDict = new Dictionary<PackType, int>(); |
| | | |
| | | public event Action<PackType> virtualPackRefresh; |
| | | int getA206Count = 0; //收到了几次A206包 |
| | | bool isFrist = false; //是不是第一次获得聚魂碎片 |
| | | // public event Action<PackType> virtualPackRefresh; |
| | | // int getA206Count = 0; //收到了几次A206包 |
| | | Dictionary<int, int> noPackItemCountDict = new Dictionary<int, int>(); //无需背包的物品数量刷新,自动转化为数值 |
| | | public event Action OnNoPackItemCountRefresh; |
| | | |
| | | public void OnBeforePlayerDataInitialize() |
| | | { |
| | | foreach (var packType in virtualPackItems.Keys) |
| | | { |
| | | var pool = m_VirtualItemPool[packType]; |
| | | var items = virtualPackItems[packType]; |
| | | foreach (var item in items) |
| | | { |
| | | pool.Release(item); |
| | | } |
| | | } |
| | | virtualPackItems.Clear(); |
| | | // foreach (var packType in virtualPackItems.Keys) |
| | | // { |
| | | // var pool = m_VirtualItemPool[packType]; |
| | | // var items = virtualPackItems[packType]; |
| | | // foreach (var item in items) |
| | | // { |
| | | // pool.Release(item); |
| | | // } |
| | | // } |
| | | // virtualPackItems.Clear(); |
| | | noPackItemCountDict.Clear(); |
| | | getA206Count = 0; |
| | | isFrist = false; |
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | isFrist = noPackItemCountDict.Count == 0; |
| | | } |
| | | |
| | | public override void Init() |
| | | { |
| | | base.Init(); |
| | | ParseConfig(); |
| | | m_VirtualItemPool.Add(PackType.GatherSoul, new ObjectPool<VirtualPackItem>(OnGetItem, OnReleaseItem)); |
| | | m_VirtualItemPool.Add(PackType.RunePack, new ObjectPool<VirtualPackItem>(OnGetItem, OnReleaseItem)); |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | // m_VirtualItemPool.Add(PackType.GatherSoul, new ObjectPool<VirtualPackItem>(OnGetItem, OnReleaseItem)); |
| | | // m_VirtualItemPool.Add(PackType.RunePack, new ObjectPool<VirtualPackItem>(OnGetItem, OnReleaseItem)); |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitialize; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | base.Release(); |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitialize; |
| | | } |
| | | |
| | | void ParseConfig() |
| | |
| | | // virtualPackCapacityDict.Add(PackType.RunePack, int.Parse(funcConfig.Numerical1)); |
| | | } |
| | | |
| | | public bool IsVirtualPack(PackType packType) |
| | | { |
| | | switch (packType) |
| | | { |
| | | case PackType.GatherSoul: |
| | | case PackType.RunePack: |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | // public bool IsVirtualPack(PackType packType) |
| | | // { |
| | | // switch (packType) |
| | | // { |
| | | // case PackType.GatherSoul: |
| | | // case PackType.RunePack: |
| | | // return true; |
| | | // } |
| | | // return false; |
| | | // } |
| | | |
| | | public int GetPackCapacity(PackType packType) |
| | | { |
| | | if (virtualPackCapacityDict.ContainsKey(packType)) |
| | | { |
| | | return virtualPackCapacityDict[packType]; |
| | | } |
| | | return 0; |
| | | } |
| | | // public int GetPackCapacity(PackType packType) |
| | | // { |
| | | // if (virtualPackCapacityDict.ContainsKey(packType)) |
| | | // { |
| | | // return virtualPackCapacityDict[packType]; |
| | | // } |
| | | // return 0; |
| | | // } |
| | | |
| | | public int GetPackRemainCount(PackType packType) |
| | | { |
| | | var capacity = GetPackCapacity(packType); |
| | | return capacity - GetPackItemCount(packType); |
| | | } |
| | | // public int GetPackRemainCount(PackType packType) |
| | | // { |
| | | // var capacity = GetPackCapacity(packType); |
| | | // return capacity - GetPackItemCount(packType); |
| | | // } |
| | | |
| | | public int GetPackItemCount(PackType packType) |
| | | { |
| | | if (virtualPackItems.ContainsKey(packType)) |
| | | { |
| | | return virtualPackItems[packType].Count; |
| | | } |
| | | return 0; |
| | | } |
| | | // public int GetPackItemCount(PackType packType) |
| | | // { |
| | | // if (virtualPackItems.ContainsKey(packType)) |
| | | // { |
| | | // return virtualPackItems[packType].Count; |
| | | // } |
| | | // return 0; |
| | | // } |
| | | |
| | | public int GetItemCountById(PackType packType, int id) |
| | | { |
| | | var count = 0; |
| | | List<int> list; |
| | | if (TryGetItems(packType, out list)) |
| | | { |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | VirtualPackItem item; |
| | | if (TryGetItem(packType, list[i], out item) |
| | | && item.id == id) |
| | | { |
| | | count++; |
| | | } |
| | | } |
| | | } |
| | | return count; |
| | | } |
| | | // public int GetItemCountById(PackType packType, int id) |
| | | // { |
| | | // var count = 0; |
| | | // List<int> list; |
| | | // if (TryGetItems(packType, out list)) |
| | | // { |
| | | // for (int i = 0; i < list.Count; i++) |
| | | // { |
| | | // VirtualPackItem item; |
| | | // if (TryGetItem(packType, list[i], out item) |
| | | // && item.id == id) |
| | | // { |
| | | // count++; |
| | | // } |
| | | // } |
| | | // } |
| | | // return count; |
| | | // } |
| | | |
| | | public void GetItemIndexs(PackType packType, ref List<int> list) |
| | | { |
| | | list.Clear(); |
| | | List<VirtualPackItem> _list; |
| | | if (virtualPackItems.TryGetValue(packType, out _list)) |
| | | { |
| | | for (int i = 0; i < _list.Count; i++) |
| | | { |
| | | list.Add(_list[i].index); |
| | | } |
| | | } |
| | | } |
| | | // public void GetItemIndexs(PackType packType, ref List<int> list) |
| | | // { |
| | | // list.Clear(); |
| | | // List<VirtualPackItem> _list; |
| | | // if (virtualPackItems.TryGetValue(packType, out _list)) |
| | | // { |
| | | // for (int i = 0; i < _list.Count; i++) |
| | | // { |
| | | // list.Add(_list[i].index); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | public bool TryGetItems(PackType packType, out List<int> list) |
| | | { |
| | | list = new List<int>(); |
| | | List<VirtualPackItem> _list; |
| | | if (virtualPackItems.TryGetValue(packType, out _list)) |
| | | { |
| | | for (int i = 0; i < _list.Count; i++) |
| | | { |
| | | list.Add(_list[i].index); |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | // public bool TryGetItems(PackType packType, out List<int> list) |
| | | // { |
| | | // list = new List<int>(); |
| | | // List<VirtualPackItem> _list; |
| | | // if (virtualPackItems.TryGetValue(packType, out _list)) |
| | | // { |
| | | // for (int i = 0; i < _list.Count; i++) |
| | | // { |
| | | // list.Add(_list[i].index); |
| | | // } |
| | | // return true; |
| | | // } |
| | | // return false; |
| | | // } |
| | | |
| | | public bool TryGetItem<T>(PackType packType, int packIndex, out T item) where T : VirtualPackItem |
| | | { |
| | | item = default(T); |
| | | if (virtualPackItems.ContainsKey(packType)) |
| | | { |
| | | var _index = virtualPackItems[packType].FindIndex((x) => |
| | | { |
| | | return x.index == packIndex; |
| | | }); |
| | | if (_index != -1) |
| | | { |
| | | item = virtualPackItems[packType][_index] as T; |
| | | } |
| | | return _index != -1; |
| | | } |
| | | return false; |
| | | } |
| | | // public bool TryGetItem<T>(PackType packType, int packIndex, out T item) where T : VirtualPackItem |
| | | // { |
| | | // item = default(T); |
| | | // if (virtualPackItems.ContainsKey(packType)) |
| | | // { |
| | | // var _index = virtualPackItems[packType].FindIndex((x) => |
| | | // { |
| | | // return x.index == packIndex; |
| | | // }); |
| | | // if (_index != -1) |
| | | // { |
| | | // item = virtualPackItems[packType][_index] as T; |
| | | // } |
| | | // return _index != -1; |
| | | // } |
| | | // return false; |
| | | // } |
| | | |
| | | public void OnReceiveServerPack(HA204_tagMCVPackRefresh package) |
| | | { |
| | | var packType = (PackType)package.PackType; |
| | | if (!IsVirtualPack(packType)) |
| | | { |
| | | return; |
| | | } |
| | | List<VirtualPackItem> list; |
| | | if (!virtualPackItems.TryGetValue(packType, out list)) |
| | | { |
| | | list = new List<VirtualPackItem>(); |
| | | virtualPackItems.Add(packType, list); |
| | | } |
| | | SetVirtualItem(packType, ref list, package.VPacklItemList); |
| | | if (virtualPackRefresh != null) |
| | | { |
| | | virtualPackRefresh((PackType)package.PackType); |
| | | } |
| | | // public void OnReceiveServerPack(HA204_tagMCVPackRefresh package) |
| | | // { |
| | | // var packType = (PackType)package.PackType; |
| | | // if (!IsVirtualPack(packType)) |
| | | // { |
| | | // return; |
| | | // } |
| | | // List<VirtualPackItem> list; |
| | | // if (!virtualPackItems.TryGetValue(packType, out list)) |
| | | // { |
| | | // list = new List<VirtualPackItem>(); |
| | | // virtualPackItems.Add(packType, list); |
| | | // } |
| | | // SetVirtualItem(packType, ref list, package.VPacklItemList); |
| | | // if (virtualPackRefresh != null) |
| | | // { |
| | | // virtualPackRefresh((PackType)package.PackType); |
| | | // } |
| | | |
| | | } |
| | | // } |
| | | |
| | | public void OnReceiveServerPack(HA205_tagMCVPackClear package) |
| | | { |
| | | var packType = (PackType)package.PackType; |
| | | if (!IsVirtualPack(packType)) |
| | | { |
| | | return; |
| | | } |
| | | List<VirtualPackItem> list; |
| | | if (virtualPackItems.TryGetValue(packType, out list)) |
| | | { |
| | | var pool = m_VirtualItemPool[packType]; |
| | | for (int i = 0; i < package.Count; i++) |
| | | { |
| | | var index = package.ItemPlaceList[i]; |
| | | var items = list.FindAll((x) => |
| | | { |
| | | return x.index == index; |
| | | }); |
| | | foreach (var item in items) |
| | | { |
| | | list.Remove(item); |
| | | pool.Release(item); |
| | | } |
| | | } |
| | | if (virtualPackRefresh != null) |
| | | { |
| | | virtualPackRefresh(packType); |
| | | } |
| | | } |
| | | } |
| | | // public void OnReceiveServerPack(HA205_tagMCVPackClear package) |
| | | // { |
| | | // var packType = (PackType)package.PackType; |
| | | // if (!IsVirtualPack(packType)) |
| | | // { |
| | | // return; |
| | | // } |
| | | // List<VirtualPackItem> list; |
| | | // if (virtualPackItems.TryGetValue(packType, out list)) |
| | | // { |
| | | // var pool = m_VirtualItemPool[packType]; |
| | | // for (int i = 0; i < package.Count; i++) |
| | | // { |
| | | // var index = package.ItemPlaceList[i]; |
| | | // var items = list.FindAll((x) => |
| | | // { |
| | | // return x.index == index; |
| | | // }); |
| | | // foreach (var item in items) |
| | | // { |
| | | // list.Remove(item); |
| | | // pool.Release(item); |
| | | // } |
| | | // } |
| | | // if (virtualPackRefresh != null) |
| | | // { |
| | | // virtualPackRefresh(packType); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | public void UpdateAutoItemCountRefresh(HA206_tagMCAutoItemCountRefresh netPack) |
| | |
| | | |
| | | |
| | | |
| | | void SetVirtualItem(PackType packType, ref List<VirtualPackItem> list, HA204_tagMCVPackRefresh.tagMCVPackItem[] items) |
| | | { |
| | | var pool = m_VirtualItemPool[packType]; |
| | | for (int i = 0; i < items.Length; i++) |
| | | { |
| | | var item = list.Find((x) => |
| | | { |
| | | return x.index == items[i].ItemPlace; |
| | | }); |
| | | if (item != null) |
| | | { |
| | | item.Release(); |
| | | } |
| | | else |
| | | { |
| | | if (pool.inactivedCount > 0) |
| | | { |
| | | item = pool.Get(); |
| | | list.Add(item); |
| | | } |
| | | } |
| | | if (item == null) |
| | | { |
| | | item = VirtualPackItem.Get(packType); |
| | | list.Add(item); |
| | | } |
| | | item.ParsePackItem(items[i].ItemPlace, items[i].ItemData); |
| | | // void SetVirtualItem(PackType packType, ref List<VirtualPackItem> list, HA204_tagMCVPackRefresh.tagMCVPackItem[] items) |
| | | // { |
| | | // var pool = m_VirtualItemPool[packType]; |
| | | // for (int i = 0; i < items.Length; i++) |
| | | // { |
| | | // var item = list.Find((x) => |
| | | // { |
| | | // return x.index == items[i].ItemPlace; |
| | | // }); |
| | | // if (item != null) |
| | | // { |
| | | // item.Release(); |
| | | // } |
| | | // else |
| | | // { |
| | | // if (pool.inactivedCount > 0) |
| | | // { |
| | | // item = pool.Get(); |
| | | // list.Add(item); |
| | | // } |
| | | // } |
| | | // if (item == null) |
| | | // { |
| | | // item = VirtualPackItem.Get(packType); |
| | | // list.Add(item); |
| | | // } |
| | | // item.ParsePackItem(items[i].ItemPlace, items[i].ItemData); |
| | | |
| | | } |
| | | } |
| | | // } |
| | | // } |
| | | |
| | | static void OnGetItem(VirtualPackItem item) |
| | | { |
| | | // static void OnGetItem(VirtualPackItem item) |
| | | // { |
| | | |
| | | } |
| | | // } |
| | | |
| | | static void OnReleaseItem(VirtualPackItem item) |
| | | { |
| | | item.Release(); |
| | | } |
| | | // static void OnReleaseItem(VirtualPackItem item) |
| | | // { |
| | | // item.Release(); |
| | | // } |
| | | } |
| | | |
| | | public abstract class VirtualPackItem |
| | |
| | | Redpoint osGalaRedpoint = new Redpoint(RedPoint_OSGala);
|
| | |
|
| | | public const int RedPoint_Download = 116;
|
| | | public Redpoint downLoadRedpoint = new Redpoint(MainRedDot.RedPoint_Download);
|
| | | //红颜
|
| | | public const int Redpoint_BeautyMM = 117;
|
| | | //古宝
|
| | | public const int RedPoint_GuaBao = 118;
|
| | | //武将卡
|
| | | public const int HeroCardRedpoint = 200;
|
| | | public Redpoint HeroListRedpoint = new Redpoint(MainHerosRedpoint, HeroCardRedpoint);
|
| | |
| | | AutoFight = 20,//自动战斗 |
| | | Recharge = 22,//充值 |
| | | PrivilegeCard = 25, //特权卡 |
| | | GuaBao = 28, //古宝 |
| | | Horse = 37, //坐骑 |
| | | HeroAwake = 38, //武将觉醒 |
| | | BattlePass = 40, //基金(战令) |
| | |
| | | } |
| | | |
| | | |
| | | //功能品质文字颜色,哪些功能由美术决定,目前用于古宝 |
| | | public static Color GetFuncQualityColor(int quality) |
| | | { |
| | | |
| | | switch (quality) |
| | | { |
| | | case 1: |
| | | // bbd5ff |
| | | return new Color32(187, 213, 255, 255); |
| | | case 2: |
| | | // e4bbfe |
| | | return new Color32(228, 187, 254, 255); |
| | | case 3: |
| | | // f7eba4 |
| | | return new Color32(247, 235, 164, 255); |
| | | case 4: |
| | | // ffc096 |
| | | return new Color32(255, 192, 150, 255); |
| | | case 5: |
| | | // fe9896 |
| | | return new Color32(254, 152, 150, 255); |
| | | } |
| | | return Color.white; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //needName 指官职0是否需要名称 |
| | | public static string GetRealmName(int realmLv, bool bright = true, bool needName = false) |