Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
1 文件已复制
1个文件已删除
2 文件已重命名
75个文件已添加
86个文件已修改
| | |
| | | _index++; |
| | | } |
| | | |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerDataInitializeEvent; |
| | | DTC0102_tagCDBPlayer.switchAccountEvent -= SwitchAccountEvent; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent; |
| | | DTC0102_tagCDBPlayer.switchAccountEvent += SwitchAccountEvent; |
| | | |
| | |
| | | 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 字典
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年11月9日
|
| | | // [ Date ]: Friday, January 9, 2026
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int[][] SelectItemInfo;
|
| | | public string Icon;
|
| | | public int PayType;
|
| | | public int SortNum;
|
| | | public int Percentage;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | |
| | |
|
| | | int.TryParse(tables[14],out PayType);
|
| | |
|
| | | int.TryParse(tables[15],out Percentage); |
| | | int.TryParse(tables[15],out SortNum); |
| | |
|
| | | int.TryParse(tables[16],out Percentage); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年11月17日
|
| | | // [ Date ]: Tuesday, January 6, 2026
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public float QunFinalDamPerDefRatio;
|
| | | public float PVPDamPerRatio;
|
| | | public float PVPDamPerDefRatio;
|
| | | public float GuanchuanRatio;
|
| | | public float GuanchuanDefRatio;
|
| | | public float ZhaojiaRatio;
|
| | | public float ZhaojiaDefRatio;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | |
| | | float.TryParse(tables[42],out PVPDamPerRatio);
|
| | |
|
| | | float.TryParse(tables[43],out PVPDamPerDefRatio);
|
| | |
|
| | | float.TryParse(tables[44],out GuanchuanRatio); |
| | |
|
| | | float.TryParse(tables[45],out GuanchuanDefRatio); |
| | |
|
| | | float.TryParse(tables[46],out ZhaojiaRatio); |
| | |
|
| | | float.TryParse(tables[47],out ZhaojiaDefRatio); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| 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 |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: Monday, January 5, 2026
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class OPConfigConfig : ConfigBase<string, OPConfigConfig>
|
| | | {
|
| | | static OPConfigConfig()
|
| | | {
|
| | | // 访问过静态构造函数
|
| | | visit = true; |
| | | }
|
| | |
|
| | | public string key;
|
| | | public string content;
|
| | |
|
| | | public override string LoadKey(string _key)
|
| | | {
|
| | | string key = GetKey(_key);
|
| | | return key;
|
| | | }
|
| | |
|
| | | public override void LoadConfig(string input)
|
| | | {
|
| | | try {
|
| | | string[] tables = input.Split('\t');
|
| | | key = tables[0];
|
| | |
|
| | | content = tables[1];
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 32c565354415f684caa3b661b741be5d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年12月8日
|
| | | // [ Date ]: 2026年1月8日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int MoneyOriginal;
|
| | | public int UnlockType;
|
| | | public int UnlockValue;
|
| | | public int IsExclusive;
|
| | | public string Name;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | |
| | |
|
| | | int.TryParse(tables[12],out UnlockValue);
|
| | |
|
| | | Name = tables[13];
|
| | | int.TryParse(tables[13],out IsExclusive); |
| | |
|
| | | Name = tables[14];
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| 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; |
| | | using System.Linq; |
| | | |
| | | public partial class GubaoResonanceAttrConfig : ConfigBase<int, GubaoResonanceAttrConfig> |
| | | { |
| | | static Dictionary<int, Dictionary<int, GubaoResonanceAttrConfig>> suiteCfgDict = new Dictionary<int, Dictionary<int, GubaoResonanceAttrConfig>>(); |
| | | |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!suiteCfgDict.ContainsKey(ResonanceID)) |
| | | { |
| | | suiteCfgDict[ResonanceID] = new Dictionary<int, GubaoResonanceAttrConfig>(); |
| | | } |
| | | suiteCfgDict[ResonanceID][ResonanceStar] = this; |
| | | } |
| | | |
| | | |
| | | public static GubaoResonanceAttrConfig GetConfig(int ResonanceID, int ResonanceStar) |
| | | { |
| | | if (suiteCfgDict.ContainsKey(ResonanceID)) |
| | | { |
| | | if (suiteCfgDict[ResonanceID].ContainsKey(ResonanceStar)) |
| | | { |
| | | return suiteCfgDict[ResonanceID][ResonanceStar]; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | // 获取当前激活的星级,-1 代表没有激活 |
| | | //_star 是套装里的最小星级 |
| | | public static int GetActiveStar(int ResonanceID, int _star) |
| | | { |
| | | int activeStar = -1; |
| | | if (suiteCfgDict.ContainsKey(ResonanceID)) |
| | | { |
| | | // 找不到当前星级,找最接近的星级 |
| | | var keys = suiteCfgDict[ResonanceID].Keys.ToList(); |
| | | keys.Sort(); |
| | | foreach (var star in keys) |
| | | { |
| | | if (_star >= star) |
| | | { |
| | | activeStar = star; |
| | | } |
| | | } |
| | | |
| | | } |
| | | return activeStar; |
| | | } |
| | | |
| | | // 获取临近的星级,先取下一个激活的星级, 最大的就取前一星 |
| | | public static int GetNearStar(int ResonanceID, int _Star) |
| | | { |
| | | var keys = suiteCfgDict[ResonanceID].Keys.ToList(); |
| | | keys.Sort(); |
| | | foreach (var star in keys) |
| | | { |
| | | if (_Star < star) |
| | | { |
| | | return star; |
| | | } |
| | | } |
| | | return keys[keys.Count - 2]; |
| | | } |
| | | |
| | | public static List<int> GetStarList(int ResonanceID) |
| | | { |
| | | var keys = suiteCfgDict[ResonanceID].Keys.ToList(); |
| | | keys.Sort(); |
| | | return keys; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5c38487f61edd9b4b894c98d224f1108 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | public partial class GubaoResonanceConfig : ConfigBase<int, GubaoResonanceConfig> |
| | | { |
| | | static Dictionary<int, int> gbIDToSuiteIDDict = new Dictionary<int, int>(); |
| | | |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | for (int i = 0; i < GubaoIDList.Length; i++) |
| | | { |
| | | gbIDToSuiteIDDict[GubaoIDList[i]] = ResonanceID; |
| | | } |
| | | } |
| | | |
| | | public static int GetSuiteIDByGubaoID(int gbID) |
| | | { |
| | | if (gbIDToSuiteIDDict.ContainsKey(gbID)) |
| | | { |
| | | return gbIDToSuiteIDDict[gbID]; |
| | | } |
| | | return 0; |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: aa382e59e7d53d445a14104e4d7d2e3d |
| | | 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: |
| | |
| | | } |
| | | } |
| | | |
| | | public static string GetBaseFullDescription(int id, long value, string format="{0}+{1}") |
| | | //基础属性描述 |
| | | public static string GetBaseFullDescription(int id, long value, string format = "{0}+{1}") |
| | | { |
| | | var config = Get(id); |
| | | if (config == null) |
| | |
| | | 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) |
| | |
| | | var downloadTask = new DownloadHotTask(remoteURL, localURL); |
| | | downloadTask.BeginDownload(AssetVersionUtility.OnDownLoadPriorBundle); |
| | | |
| | | |
| | | remoteURL = StringUtility.Concat(VersionUtility.Instance.versionInfo.GetResourcesURL(VersionConfig.Get().branch), Language.fixPath, $"/config/{VersionConfig.Get().appId}OPConfig.txt"); |
| | | localURL = StringUtility.Concat(ResourcesPath.Instance.ExternalStorePath, "config/OPConfig.txt"); |
| | | var downloadTask2 = new DownloadHotTask(remoteURL, localURL); |
| | | downloadTask2.BeginDownload(AssetVersionUtility.OnDownLoadOPConfig); |
| | | //AssetVersionUtility.GetAssetVersionFile(); |
| | | done = false; |
| | | progress = 0f; |
| 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: |
| | |
| | | {
|
| | | //只有回登录界面后的断线重连 和初次登录才加载游戏场景
|
| | | StageManager.Instance.ToGameScene();
|
| | | DayRemind.Instance.SetDayRemind(DayRemind.DJQTip, false);
|
| | | }
|
| | | isAfterPlayerDataInitialize = true;
|
| | |
|
| | |
| | | //类型 |
| | | static Dictionary<int, ulong> lastPackUIDDict = new Dictionary<int, ulong>() |
| | | { |
| | | // #if UNITY_EDITOR |
| | | #if UNITY_EDITOR |
| | | {(int)PlayerDataType.ExAttr1, 0}, |
| | | {(int)PlayerDataType.ExAttr2, 0}, |
| | | // #endif |
| | | #endif |
| | | {(int)PlayerDataType.default26, 0}, |
| | | }; |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | |
| | | {
|
| | | 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)); |
| | | } |
| | | |
| | | //主工程注册封包 |
| | |
| | | // A3 50 通知寻宝结果 #tagMCTreasureResult
|
| | |
|
| | | public class HA350_tagMCTreasureResult : GameNetPackBasic {
|
| | | public byte TreasureType; //寻宝类型
|
| | | public byte TreasureIndex; //寻宝索引
|
| | | public byte CostType; //消耗类型:0-默认仙玉;1-免费次数;2-寻宝道具
|
| | | public byte AddMoneyType; // 本次寻宝增加的积分货币类型,可能为0
|
| | | public ushort AddMoneyValue; // 本次寻宝增加的积分货币值,可能为0
|
| | | public ushort AddTreasureLuck; // 本次寻宝增加的幸运值
|
| | |
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out TreasureType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out TreasureIndex, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out CostType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out AddMoneyType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out AddMoneyValue, vBytes, NetDataType.WORD);
|
| | | TransBytes (out AddTreasureLuck, vBytes, NetDataType.WORD);
|
| 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: |
| | |
| | | TransBytes (out FactionList[i].LineupList[j].ObjList[k].LV, vBytes, NetDataType.WORD); |
| | | TransBytes (out FactionList[i].LineupList[j].ObjList[k].PosNum, vBytes, NetDataType.BYTE); |
| | | TransBytes (out FactionList[i].LineupList[j].ObjList[k].AngreXP, vBytes, NetDataType.WORD); |
| | | TransBytes (out FactionList[i].LineupList[j].ObjList[k].FightPower, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FactionList[i].LineupList[j].ObjList[k].FightPowerEx, vBytes, NetDataType.DWORD); |
| | | } |
| | | } |
| | | } |
| | |
| | | public ushort LV; // 等级,玩家的武将等级或NPC成长等级,等级显示以该值为准 |
| | | public byte PosNum; // 在本阵容中的站位,从1开始,非主战斗武将为0,如红颜 |
| | | public ushort AngreXP; // 当前怒气值 |
| | | public uint FightPower; // 战力,求余亿部分 |
| | | public uint FightPowerEx; // 战力,整除亿部分 |
| | | } |
| | | |
| | | public class tagSCTurnFightLineup { |
| | |
| | | managers.Add(HeroFatesManager.Instance);
|
| | | managers.Add(BeautyMMManager.Instance);
|
| | | managers.Add(DailySpecialsManager.Instance);
|
| | | managers.Add(GubaoManager.Instance);
|
| | | foreach (var manager in managers)
|
| | | {
|
| | | manager.Init();
|
| | |
| | | private string m_EncodeKey = "03sujm7gerywdvyd5vkkk772rs4by230"; |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 自由SDK支付 fixed sdk 支付逻辑修改 |
| | |
| | | } |
| | | else |
| | | { |
| | | ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get("GameCashRule1", money, title), Language.Get("TodayNoNotify"), (bool isOk, bool isToggle) => |
| | | ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get("GameCashRule1", money, title), Language.Get("ConfirmCancel102"), (bool isOk, bool isToggle) => |
| | | { |
| | | if (isOk) |
| | | { |
| | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | { |
| | | FreePlatformPayEx(title, money, cpInfo); |
| | | } |
| | | } |
| | |
| | | PlayerDatas.Instance.baseData.face, |
| | | PlayerDatas.Instance.baseData.facePic)); |
| | | enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)tagPlayerID, (int)enemyFace, (int)enemyFacePic)); |
| | | enemyAvatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | }); |
| | | |
| | | txtMyName.text = PlayerDatas.Instance.baseData.PlayerName; |
| | | txtEnemyName.text = UIHelper.ServerStringTrim(info.PlayerName); |
| | | txtMyScore.text = Language.Get("Arena17", atkAddScore); |
| | |
| | | [SerializeField] ButtonEx detailBtn; |
| | | JsonData jsonData; |
| | | string battleName = BattleConst.ArenaBattleField; |
| | | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | detailBtn.SetListener(() => |
| | |
| | | PlayerDatas.Instance.baseData.face, |
| | | PlayerDatas.Instance.baseData.facePic)); |
| | | enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)tagPlayerID, (int)enemyFace, (int)enemyFacePic)); |
| | | enemyAvatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | }); |
| | | |
| | | txtMyName.text = PlayerDatas.Instance.baseData.PlayerName; |
| | | txtEnemyName.text = UIHelper.ServerStringTrim(info.PlayerName); |
| | | txtMyScore.text = Language.Get("Arena17", atkAddScore); |
| | |
| | | arenaMatchInfo = list[index]; |
| | | |
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)arenaMatchInfo.PlayerID, (int)arenaMatchInfo.Face, (int)arenaMatchInfo.FacePic)); |
| | | avatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)arenaMatchInfo.PlayerID, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | }); |
| | | |
| | | txtName.text = UIHelper.ServerStringTrim(arenaMatchInfo.PlayerName); |
| | | txtFightPoint.text = UIHelper.ReplaceLargeArtNum(arenaMatchInfo.FightPower); |
| | | txtAddScore.text = Language.Get("Arena16", ArenaManager.Instance.GetChallengePoints(index)); |
| | |
| | | { |
| | | CreateScroller(); |
| | | voucher.Display(); |
| | | txtFightPoint.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower); |
| | | long myFightPower = ArenaManager.Instance.GetMyFightPower(); |
| | | txtFightPoint.text = UIHelper.ReplaceLargeArtNum(myFightPower); |
| | | imgMoneyIcon.SetIconWithMoneyType(ArenaManager.Instance.currencyType); |
| | | txtMoneyCount.text = UIHelper.ShowUseMoney(ArenaManager.Instance.currencyType, ArenaManager.Instance.currencyValue); |
| | | } |
| | |
| | | sortedList.Sort((a, b) => b.Time.CompareTo(a.Time)); // 按时间从大到小排序 |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | //优先取进攻队伍的战力,没有进攻队伍,取主线战力 |
| | | public long GetMyFightPower() |
| | | { |
| | | var arenaDefenseTeam = TeamManager.Instance.GetTeam(TeamType.Arena); |
| | | return arenaDefenseTeam.IsEmpty() || arenaDefenseTeam.GetTeamHeroCount() <= 0 ? |
| | | PlayerDatas.Instance.baseData.FightPower : |
| | | FightPowerManager.Instance.GetTeamFightPower(TeamType.Arena, false); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | public void Display(int rankType, int rank, string valueFormat) |
| | | { |
| | | RankData rankData = null; |
| | | int viewPlayerId = (int)PlayerDatas.Instance.baseData.PlayerID; |
| | | if (rank != 0) |
| | | { |
| | | rankData = RankModel.Instance.GetRankDataByRank(rankType, rank); |
| | |
| | | } |
| | | else |
| | | { |
| | | viewPlayerId = (int)rankData.id; |
| | | officialTitleCell.SetActive(true); |
| | | officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2); |
| | | avatarCell.SetActive(true); |
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)rankData.id, (int)rankData.value3, (int)rankData.value4)); |
| | | avatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | }); |
| | | nameText.text = rankData.name1; |
| | | rankValueText.text = string.Format(valueFormat, UIHelper.ReplaceLargeNum(rankData.cmpValue)); |
| | | } |
| | |
| | | { |
| | | queryPlayerBtn.AddListener(() => |
| | | { |
| | | |
| | | AvatarHelper.TryViewOtherPlayerInfo(viewPlayerId, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | }); |
| | | } |
| | | } |
| | |
| | | nameText.text = rankData.name1; |
| | | officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2); |
| | | model.Create(HorseManager.Instance.GetOtherPlayerHorseSkinID((int)rankData.value6), (int)rankData.value5, 1); |
| | | queryPlayerBtn.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)arenaGameRec.Value3, (int)arenaGameRec.Value5, (int)arenaGameRec.Value6)); |
| | | avatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)arenaGameRec.Value3, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | }); |
| | | txtName.text = arenaGameRec.Name; |
| | | txtFightPoint.text = UIHelper.ReplaceLargeArtNum(arenaGameRec.FightPower); |
| | | officialTitleCell.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID); |
| | |
| | | { |
| | | CreateScroller(); |
| | | voucher.Display(); |
| | | txtFightPoint.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower); |
| | | long myFightPower = ArenaManager.Instance.GetMyFightPower(); |
| | | txtFightPoint.text = UIHelper.ReplaceLargeArtNum(myFightPower); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public static void OnDownLoadOPConfig(DownloadHotTask task) |
| | | { |
| | | if (task.IsDone) |
| | | { |
| | | OPConfigConfig.LazyInit(); |
| | | } |
| | | else |
| | | { |
| | | //一直尝试下载 |
| | | task.BeginDownload(OnDownLoadOPConfig); |
| | | Debug.Log("OnDownLoadOPConfig fail - before AssetVersion"); |
| | | } |
| | | } |
| | | public static void GetAssetVersionFile() |
| | | { |
| | | checkAssetCompleted = false; |
| | |
| | | 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() |
| | |
| | | private void OnDestroy()
|
| | | {
|
| | | m_ViewDownLoad.RemoveAllListeners();
|
| | | InGameDownLoad.Instance.downLoadStateChangeEvent -= OnDownLoadStateChange;
|
| | | InGameDownLoad.Instance.dominantDownLoadEvent -= OnDownLoadDominantStateChange;
|
| | | |
| | | }
|
| | |
|
| | | private void OnDownLoadDominantStateChange(InGameDownLoad.Dominant _dominant)
|
| | |
| | | |
| | | } |
| | | |
| | | private long GetFightPonit(List<BattleObject> Team) |
| | | { |
| | | if (Team.IsNullOrEmpty()) |
| | | { |
| | | return 0; |
| | | } |
| | | long res = 0; |
| | | foreach (var obj in Team) |
| | | { |
| | | if (obj.teamHero == null) |
| | | continue; |
| | | res += obj.teamHero.fightPower; |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | private void DisplayPlayerInfo() |
| | | { |
| | | if (battleField == null) |
| | |
| | | |
| | | txtEnemyLV.text = Language.Get("Arena22", info.Lv); |
| | | txtEnemyName.text = UIHelper.ServerStringTrim(info.PlayerName); |
| | | txtEnemyFightPonit.text = UIHelper.ReplaceLargeArtNum(info.FightPower); |
| | | txtEnemyFightPonit.text = UIHelper.ReplaceLargeArtNum(GetFightPonit(enemyTeam)); |
| | | enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)info.PlayerID, (int)info.Face, (int)info.FacePic)); |
| | | |
| | | enemyAvatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)info.PlayerID, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | }); |
| | | var team = GetTeamHeroList(enemyTeam); |
| | | enemyCountry.RefreshOnTeamCountry(team, true); |
| | | |
| | | txtMyLV.text = Language.Get("Arena22", PlayerDatas.Instance.baseData.LV); |
| | | txtMyName.text = PlayerDatas.Instance.baseData.PlayerName; |
| | | txtMyFightPonit.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower); |
| | | long myFightPower = GetFightPonit(myTeam); |
| | | txtMyFightPonit.text = UIHelper.ReplaceLargeArtNum(myFightPower); |
| | | myAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID, PlayerDatas.Instance.baseData.face, PlayerDatas.Instance.baseData.facePic)); |
| | | team = GetTeamHeroList(myTeam); |
| | | myCountry.RefreshOnTeamCountry(team, true); |
| | |
| | | if (!FuncOpenLVConfig.HasKey(passFuncId)) |
| | | return true; |
| | | int lv = FuncOpenLVConfig.Get(passFuncId).LimitLV; |
| | | SysNotifyMgr.Instance.ShowTip("BattlePass2", lv); |
| | | SysNotifyMgr.Instance.ShowTip("BattlePass4", lv); |
| | | return false; |
| | | } |
| | | |
| | |
| | | // 主线BOSS战场特殊提示 |
| | | if (battleFieldName == BattleConst.StoryBossBattleField) |
| | | { |
| | | if (!hasForeverPrivilege || IsStoryBossChapterLimited()) |
| | | int lv = PlayerDatas.Instance.baseData.LV; |
| | | if (lv <= BattleManager.Instance.passLV) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("BattlePass3", waitRound, BattleManager.Instance.passChapterID); |
| | | if (!hasForeverPrivilege || IsStoryBossChapterLimited()) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("BattlePass3", waitRound, BattleManager.Instance.passChapterID); |
| | | } |
| | | else |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("BattlePass", waitRound); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("BattlePass", waitRound); |
| | | if (hasForeverPrivilege && IsStoryBossChapterLimited()) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("BattlePass3", waitRound, BattleManager.Instance.passChapterID); |
| | | } |
| | | else |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("BattlePass", waitRound); |
| | | } |
| | | } |
| | | } |
| | | // 其他战场提示 |
| | | else |
| | | { |
| | | if (hasForeverPrivilege) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("BattlePass", waitRound); |
| | | } |
| | | else |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("BattlePass1", waitRound); |
| | | } |
| | | |
| | | SysNotifyMgr.Instance.ShowTip("BattlePass", waitRound); |
| | | } |
| | | } |
| | | |
| | |
| | | public Dictionary<int, int> passDict = new Dictionary<int, int>(); |
| | | public Dictionary<int, int> foreverPrivilegePassDict = new Dictionary<int, int>(); |
| | | public int passChapterID; |
| | | public int passLV; |
| | | |
| | | public int fightBossGuideID; |
| | | public int fightGuideMainLevelLimit; |
| | |
| | | passDict = ConfigParse.ParseIntDict(config.Numerical2); |
| | | foreverPrivilegePassDict = ConfigParse.ParseIntDict(config.Numerical3); |
| | | passChapterID = int.Parse(config.Numerical4); |
| | | passLV = int.Parse(config.Numerical5); |
| | | } |
| | | |
| | | |
| | |
| | | [SerializeField] ScrollerController scroller;
|
| | | [SerializeField] Transform rechargeRect;
|
| | | [SerializeField] ItemCell itemCell;
|
| | | [SerializeField] Text adItemText;
|
| | | [SerializeField] Button buyBtn;
|
| | | [SerializeField] Text buyText;
|
| | |
|
| | |
| | | buyText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale);
|
| | |
|
| | | var config = CTGConfig.Get(ctgID);
|
| | | //约定第一个武将物品
|
| | | int itemID = config.GainItemList[0][0];
|
| | | itemCell.Init(new ItemCellModel(itemID, false, config.GainItemList[0][1]));
|
| | | itemCell.button.AddListener(() =>
|
| | | {
|
| | | ItemTipUtility.Show(itemID);
|
| | | });
|
| | | adItemText.text = Language.Get("BattlePass7_" + itemID);
|
| | | _rect.sizeDelta = new Vector2(_rect.rect.width, 630);
|
| | | }
|
| | | else
|
| | |
| | | } |
| | | case BattlePassType.GuBao: |
| | | { |
| | | return (int)battlePassData.value1; |
| | | return GubaoManager.Instance.GetGubaoTotalCnt(); |
| | | } |
| | | case BattlePassType.Arena: |
| | | { |
| | |
| | | [SerializeField] Text rankValueText; //排名比较内容
|
| | | [SerializeField] Text nameText;
|
| | | [SerializeField] OfficialTitleCell officialTitleCell;
|
| | |
|
| | | [SerializeField] Button queryPlayerBtn; //后续添加点击查看玩家详情
|
| | |
|
| | | // rank 为0 代表玩家自己
|
| | | public void Display(int rankType, int rank)
|
| | | {
|
| | | RankData rankData = null;
|
| | | int viewPlayerId = (int)PlayerDatas.Instance.baseData.PlayerID;
|
| | | if (rank != 0)
|
| | | {
|
| | | rankData = RankModel.Instance.GetRankDataByRank(rankType, rank);
|
| | |
| | | officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2);
|
| | | avatarCell.SetActive(true);
|
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)rankData.id, (int)rankData.value3, (int)rankData.value4));
|
| | | viewPlayerId = (int)rankData.id;
|
| | | nameText.text = rankData.name1;
|
| | | rankValueText.text = RankModel.Instance.GetCmpValueStr(rankType, rankData.cmpValue); ;
|
| | | }
|
| | |
|
| | | rankText.text = rank.ToString();
|
| | |
|
| | | if (queryPlayerBtn != null)
|
| | | {
|
| | | queryPlayerBtn.AddListener(() =>
|
| | | {
|
| | | AvatarHelper.TryViewOtherPlayerInfo(viewPlayerId);
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] Text rankValueText; //排名比较内容
|
| | | [SerializeField] Text nameText;
|
| | | [SerializeField] OfficialTitleCell officialTitleCell;
|
| | | [SerializeField] Button queryPlayerBtn; //后续添加点击查看玩家详情
|
| | | [SerializeField] HorseController model;
|
| | |
|
| | | public void Display(int rankType, int rank)
|
| | |
| | | nameText.text = rankData.name1;
|
| | | officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2);
|
| | | model.Create(HorseManager.Instance.GetOtherPlayerHorseSkinID((int)rankData.value6), (int)rankData.value5, rank == 1 ? 1f : 0.8f);
|
| | | queryPlayerBtn.SetListener(() =>
|
| | | {
|
| | | AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id);
|
| | | });
|
| | | }
|
| | |
|
| | |
|
| | |
| | | case 6: |
| | | SendGetReward(ADID); |
| | | break; |
| | | case 5: |
| | | GubaoManager.Instance.selectCallIndex = 0; |
| | | SendGetReward(ADID); |
| | | break; |
| | | } |
| | | } |
| | | |
| | |
| | | List<Item> showItems = new List<Item>(); |
| | | foreach (var item in result.itemInfo) |
| | | { |
| | | Item tempItem = new Item(item.ItemID, item.Count, _useType: item.BeautyEx + 1); |
| | | Item tempItem = new Item(item.ItemID, item.Count, _useType: item.BeautyEx != 0 ? 2 : 0); |
| | | showItems.Add(tempItem); |
| | | } |
| | | ItemLogicUtility.Instance.ShowGetItem(showItems, isMergeItem: false); |
| | |
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID, |
| | | PlayerDatas.Instance.baseData.face, |
| | | PlayerDatas.Instance.baseData.facePic)); |
| | | avatarCell.button.SetListener(() => |
| | | { |
| | | |
| | | }); |
| | | |
| | | title.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID); |
| | | if (manager.nowChatTab == ChatTab.World) |
| | |
| | | TalkData data = hasNewPlayerInfo ? newPlayerInfo : nowData; |
| | | |
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)data.PlayerID, (int)data.Face, (int)data.FacePic, data.Job)); |
| | | avatarCell.button.SetListener(() => |
| | | { |
| | | |
| | | }); |
| | | |
| | | title.InitUI(data.RealmLV, (int)data.TitleID); |
| | | int bubbleID = ChatBubbleHelper.GetOtherChatBubbleID(data.Job, (int)data.BubbleBox); |
| | | m_ChatBubble.DisplayBubble(bubbleID, (int)data.PlayerID); |
| | |
| | | scrWorld.OnGetDynamicSize += OnGetWorldChatDynamicSize; |
| | | scrWorld.OnRefreshCell += OnRefreshWorldCell; |
| | | scrWorld.mScrollRect.onValueChanged.AddListener(OnWorldScrollValChange); |
| | | scrGuild.OnGetDynamicSize += OnGetWorldChatDynamicSize; |
| | | scrGuild.OnGetDynamicSize += OnGetGuildChatDynamicSize; |
| | | scrGuild.OnRefreshCell += OnRefreshGuildCell; |
| | | scrGuild.mScrollRect.onValueChanged.AddListener(OnGuildScrollValChange); |
| | | |
| | |
| | | using DG.Tweening; |
| | | using Cysharp.Threading.Tasks; |
| | | |
| | | //目前没用,用的是SDK的 |
| | | public class RequestSecretWin : UIBase |
| | | { |
| | | // 组件引用 |
| | |
| | | base.InitComponent(); |
| | | // 初始化组件引用 |
| | | m_Confirm.SetListener(Confirm); |
| | | m_Cannel.SetListener(() => { |
| | | m_Cannel.SetListener(() => |
| | | { |
| | | Debug.LogError("Cannel"); |
| | | CloseWindow(); |
| | | #if UNITY_EDITOR |
| | |
| | | Application.Quit(); |
| | | #endif |
| | | }); |
| | | m_Fuwu.SetListener(()=> { |
| | | GameAgeWarnWin.data = 1; |
| | | UIManager.Instance.OpenWindow<GameAgeWarnWin>(); |
| | | m_Fuwu.SetListener(() => |
| | | { |
| | | // GameAgeWarnWin.data = 1; |
| | | // UIManager.Instance.OpenWindow<GameAgeWarnWin>(); |
| | | }); |
| | | m_Yinsi.SetListener(() => { |
| | | GameAgeWarnWin.data = 2; |
| | | UIManager.Instance.OpenWindow<GameAgeWarnWin>(); |
| | | m_Yinsi.SetListener(() => |
| | | { |
| | | // GameAgeWarnWin.data = 2; |
| | | // UIManager.Instance.OpenWindow<GameAgeWarnWin>(); |
| | | }); |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | if (!ctgIDList.IsNullOrEmpty()) |
| | | { |
| | | ctgIDList = ctgIDList.OrderBy(ctgId => { return manager.IsDayGiftBuy(ctgId); }).ThenBy(ctgId => ctgId).ToList(); |
| | | ctgIDList = ctgIDList |
| | | .OrderBy(ctgId => manager.IsDayGiftBuy(ctgId)) |
| | | .ThenBy(ctgId => CTGConfig.HasKey(ctgId) ? CTGConfig.Get(ctgId).SortNum : int.MaxValue) |
| | | .ThenBy(ctgId => ctgId) |
| | | .ToList(); |
| | | scroller.Refresh(); |
| | | for (int i = 0; i < ctgIDList.Count; i++) |
| | | { |
| | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin; |
| | | rechargeManager.rechargeCountEvent += OnRechargeCountEvent; |
| | | rechargeManager.rechargeCountEvent -= OnRechargeCountEvent; |
| | | StoreModel.Instance.RefreshShopEvent -= OnRefreshShopEvent; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent -= OnRefreshBuyShopLimitEvent; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChange; |
| | |
| | | } |
| | | if (!ctgIDList.IsNullOrEmpty()) |
| | | { |
| | | ctgIDList = ctgIDList.OrderBy(ctgId => { return manager.IsWeekGiftBuy(ctgId); }).ThenBy(ctgId => ctgId).ToList(); |
| | | ctgIDList = ctgIDList |
| | | .OrderBy(ctgId => manager.IsWeekGiftBuy(ctgId)) |
| | | .ThenBy(ctgId => CTGConfig.HasKey(ctgId) ? CTGConfig.Get(ctgId).SortNum : int.MaxValue) |
| | | .ThenBy(ctgId => ctgId) |
| | | .ToList(); |
| | | scroller.Refresh(); |
| | | for (int i = 0; i < ctgIDList.Count; i++) |
| | | { |
| | |
| | | CreateCmdCell(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | _cmdCtrl.OnRefreshCell -= RefreshCmdCell; |
| | | } |
| | | |
| | | protected override void OnOpen() |
| | | { |
| | | base.OnOpen(); |
| | |
| | | _gmInfoBtn.onClick.AddListener(OnClickGMInfoBtn);
|
| | | _clearBtn.onClick.AddListener(OnClickClearBtn);
|
| | | achieveJumpTestBtn.AddListener(ClickAchieveJumpBtn);
|
| | | } |
| | | }
|
| | |
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | |
|
| | | _cmdContent.SetActive(false);
|
| | | }
|
| | | |
| | | protected override void OnPreClose()
|
| | | {
|
| | | _cmdCtrl.OnRefreshCell -= RefreshCmdCell;
|
| | | }
|
| | |
|
| | | protected override void OnOpen()
|
| | | {
|
| | |
| | | protected DayRemind()
|
| | | {
|
| | | GetPlayerDayRemind();
|
| | | DTC0102_tagCDBPlayer.afterPlayerDataInitializeEvent -= AfterPlayerDataInitializeEvent;
|
| | | DTC0102_tagCDBPlayer.afterPlayerDataInitializeEvent += AfterPlayerDataInitializeEvent;
|
| | | }
|
| | |
|
| File was renamed from Main/System/RoleParticulars.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7f4be2a6d73bb8c40b77b85620ca4026 |
| | | guid: 9054f2d1e012d21458dc12cc8a624e00 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 古宝激活成功 |
| | | /// </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 && config.SpecAttrID == 0) |
| | | { |
| | | attrSpecialText.SetActive(false); |
| | | } |
| | | else if (config.SpecEffType == 0) |
| | | { |
| | | attrSpecialText.SetActive(true); |
| | | attrSpecialText.text = PlayerPropertyConfig.GetFullDescription(config.SpecAttrID, specAttrDict[config.SpecAttrID]); |
| | | } |
| | | else |
| | | { |
| | | attrSpecialText.SetActive(true); |
| | | //有特殊效果的 |
| | | 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 |
| | | { |
| | | [SerializeField] Transform bg; |
| | | [SerializeField] Transform jbbg; |
| | | protected override void OpenSubUIByTabIndex() |
| | | { |
| | | switch (functionOrder) |
| | | { |
| | | case 0: |
| | | currentSubUI = UIManager.Instance.OpenWindow<GubaoListWin>(); |
| | | jbbg.SetActive(false); |
| | | bg.SetActive(true); |
| | | break; |
| | | case 1: |
| | | currentSubUI = UIManager.Instance.OpenWindow<GubaoCallWin>(); |
| | | jbbg.SetActive(true); |
| | | bg.SetActive(false); |
| | | break; |
| | | case 2: |
| | | currentSubUI = UIManager.Instance.OpenWindow<GubaoSuiteListWin>(); |
| | | jbbg.SetActive(false); |
| | | bg.SetActive(true); |
| | | 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; |
| | | using System.Collections.Generic; |
| | | using Cysharp.Threading.Tasks; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | // 鉴宝结果 |
| | | public class GubaoCallCell : MonoBehaviour |
| | | { |
| | | [SerializeField] Image canImage; |
| | | [SerializeField] RotationTween rotationTween; //摇一摇0.5秒后,停止动-裂开特效 - 配合消失 |
| | | [SerializeField] UIEffectPlayer openEffect; //裂开特效 |
| | | [SerializeField] UIEffectPlayer showEffect; //展示特效 |
| | | [SerializeField] Image itemIcon; |
| | | [SerializeField] Text itemName; |
| | | [SerializeField] Text cntText; |
| | | [SerializeField] Image pieceImg; |
| | | [SerializeField] Transform outRect; //溢出 |
| | | [SerializeField] Image newImg; |
| | | |
| | | // 勾选跳过的直接显示结果 |
| | | public async UniTask Display(int index) |
| | | { |
| | | bool isSkip = LocalSave.GetBool(GubaoManager.skipKey + PlayerDatas.Instance.baseData.PlayerID, false); |
| | | |
| | | if (HappyXBModel.Instance.xbResultDict.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | if (!HappyXBModel.Instance.xbResultDict.ContainsKey(index)) |
| | | { |
| | | return; |
| | | } |
| | | var result = HappyXBModel.Instance.xbResultDict[index]; |
| | | var itemCfg = ItemConfig.Get(result.itemId); |
| | | var gbCfg = GubaoConfig.Get(result.itemId); |
| | | |
| | | if (isSkip) |
| | | { |
| | | canImage.SetActive(false); |
| | | rotationTween.Stop(); |
| | | openEffect.Stop(); |
| | | showEffect.PlayByArrIndex(Math.Max(itemCfg.ItemColor - 1, 0)); |
| | | itemIcon.SetActive(true); |
| | | itemName.SetActive(true); |
| | | cntText.SetActive(true); |
| | | |
| | | itemIcon.SetItemSprite(result.itemId); |
| | | itemIcon.SetNativeSize(); |
| | | itemName.text = itemCfg.ItemName; |
| | | itemName.color = UIHelper.GetFuncQualityColor(itemCfg.ItemColor); |
| | | cntText.text = "x" + result.count.ToString(); |
| | | |
| | | if (gbCfg == null) |
| | | { |
| | | pieceImg.SetActive(false); |
| | | newImg.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | pieceImg.SetActive(true); |
| | | if (GubaoManager.Instance.IsActive(result.itemId)) |
| | | { |
| | | newImg.SetActive(false); |
| | | } |
| | | else if (VirtualPackManager.Instance.GetNoPackItemCount(result.itemId) < gbCfg.UnlockItemCnt) |
| | | { |
| | | newImg.SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | newImg.SetActive(false); |
| | | } |
| | | } |
| | | outRect.SetActive(result.isOut); |
| | | |
| | | return; |
| | | } |
| | | |
| | | //动画顺序 : 罐子摇一摇0.5秒-停止动-裂开特效-罐子提前消失-展示特效 |
| | | canImage.SetActive(true); |
| | | //随机1-6 |
| | | int random = UnityEngine.Random.Range(1, 7); |
| | | canImage.SetSprite($"GubaoCan{random}"); |
| | | canImage.SetNativeSize(); |
| | | canImage.transform.localRotation = Quaternion.identity; |
| | | itemIcon.SetActive(false); |
| | | itemName.SetActive(false); |
| | | cntText.SetActive(false); |
| | | outRect.SetActive(false); |
| | | newImg.SetActive(false); |
| | | |
| | | |
| | | showEffect.Stop(); |
| | | |
| | | int delay = isSkip ? 0 : index * 100; // delay 毫秒 |
| | | await UniTask.Delay(delay); |
| | | |
| | | rotationTween.Play(); |
| | | await UniTask.Delay(300); |
| | | rotationTween.Stop(); |
| | | openEffect.Play(); |
| | | await UniTask.Delay(200); |
| | | canImage.SetActive(false); |
| | | await UniTask.Delay(400); |
| | | showEffect.PlayByArrIndex(Math.Max(itemCfg.ItemColor - 1, 0)); |
| | | itemIcon.SetActive(true); |
| | | itemName.SetActive(true); |
| | | cntText.SetActive(true); |
| | | itemIcon.SetItemSprite(result.itemId); |
| | | itemIcon.SetNativeSize(); |
| | | itemName.text = itemCfg.ItemName; |
| | | itemName.color = UIHelper.GetFuncQualityColor(itemCfg.ItemColor); |
| | | cntText.text = "x" + result.count.ToString(); |
| | | if (gbCfg == null) |
| | | { |
| | | pieceImg.SetActive(false); |
| | | newImg.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | pieceImg.SetActive(true); |
| | | if (GubaoManager.Instance.IsActive(result.itemId)) |
| | | { |
| | | newImg.SetActive(false); |
| | | } |
| | | else if (VirtualPackManager.Instance.GetNoPackItemCount(result.itemId) < gbCfg.UnlockItemCnt) |
| | | { |
| | | newImg.SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | newImg.SetActive(false); |
| | | } |
| | | } |
| | | outRect.SetActive(result.isOut); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ebac9a00058b123499b54518466683ed |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using System.Runtime.InteropServices; |
| | | using Cysharp.Threading.Tasks; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 鉴宝 |
| | | /// </summary> |
| | | public class GubaoCallWin : UIBase |
| | | { |
| | | [SerializeField] OwnItemCell ownItemCell; |
| | | [SerializeField] Toggle skipToggle; |
| | | [SerializeField] Button call1Btn; |
| | | [SerializeField] Image call1ItemIcon; |
| | | [SerializeField] Text call1Text; |
| | | [SerializeField] Text freeCDTime; |
| | | [SerializeField] Button call10Btn; |
| | | [SerializeField] Image call10ItemIcon; |
| | | [SerializeField] Text call10Text; |
| | | [SerializeField] Text callTip; |
| | | [SerializeField] Button rateBtn; |
| | | [SerializeField] Transform rateRect; |
| | | [SerializeField] Text[] rateTexts; |
| | | |
| | | [SerializeField] Transform resultObj; //展示X秒结束可点击关闭 |
| | | [SerializeField] Transform opObj; //操作区在结果展示过程会隐藏 |
| | | |
| | | |
| | | [SerializeField] UIEffectPlayer roleModel; //待机,结果3种 |
| | | // [SerializeField] Transform talkRect; //1.未鉴宝时随机 2.鉴宝过程消失 3.鉴宝结束对应不同对话 |
| | | [SerializeField] Text talkText; |
| | | |
| | | [SerializeField] Button closeResultBtn; |
| | | [SerializeField] GubaoCallCell oneResultCell; |
| | | [SerializeField] GubaoCallCell[] tenResultCells; |
| | | |
| | | float showResultTime = 0; //动画开始 |
| | | float showCD = 0; //动画结束需 单抽1秒,十连2秒;跳过也需要0.x秒展示时间(受update影响) |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | skipToggle.AddListener((value) => |
| | | { |
| | | LocalSave.SetBool(GubaoManager.skipKey + PlayerDatas.Instance.baseData.PlayerID, value); |
| | | }); |
| | | ownItemCell.itemID = TreasureSetConfig.Get((int)HappXBTitle.Gubao).CostItemID; |
| | | call1Btn.AddListener(SendGubaoCall); |
| | | call10Btn.AddListener(() => |
| | | { |
| | | GubaoManager.Instance.selectCallIndex = 1; |
| | | HappyXBModel.Instance.SendXBManyQuest((int)HappXBTitle.Gubao); |
| | | }); |
| | | rateBtn.AddListener(() => |
| | | { |
| | | rateRect.SetActive(true); |
| | | }); |
| | | ShowRate(); |
| | | closeResultBtn.AddListener(() => |
| | | { |
| | | if (Time.time - showResultTime < showCD) |
| | | { |
| | | return; |
| | | } |
| | | opObj.SetActive(true); |
| | | resultObj.SetActive(false); |
| | | ShowVenderTalk(0); |
| | | }); |
| | | } |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | HappyXBModel.Instance.RefreshXBTypeInfoAct += Display; |
| | | HappyXBModel.Instance.RefreshXBResultAct += ShowResult; |
| | | // GubaoManager.Instance.clickCallEvent += clickCallEvent; |
| | | skipToggle.isOn = LocalSave.GetBool(GubaoManager.skipKey + PlayerDatas.Instance.baseData.PlayerID, false); |
| | | opObj.SetActive(true); |
| | | resultObj.SetActive(false); |
| | | |
| | | ShowVenderTalk(0); |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | HappyXBModel.Instance.RefreshXBTypeInfoAct -= Display; |
| | | HappyXBModel.Instance.RefreshXBResultAct -= ShowResult; |
| | | // GubaoManager.Instance.clickCallEvent -= clickCallEvent; |
| | | } |
| | | |
| | | void ShowVenderTalk(int quality) |
| | | { |
| | | if (quality == 0) |
| | | { |
| | | var random = Random.Range(1, GubaoManager.Instance.maxIdleTalk + 1); |
| | | talkText.text = Language.Get("GubaoIdleTalk" + random); |
| | | roleModel.Play(0); |
| | | } |
| | | else |
| | | { |
| | | talkText.text = Language.Get("GubaoResultTalk" + quality); |
| | | roleModel.Play(GubaoManager.Instance.emojiDict[quality]); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void Display() |
| | | { |
| | | var funcSet = TreasureSetConfig.Get((int)HappXBTitle.Gubao); |
| | | var item = ItemConfig.Get(funcSet.CostItemID); |
| | | var IconKey = item.IconKey; |
| | | call1ItemIcon.SetOrgSprite(IconKey); |
| | | call10ItemIcon.SetOrgSprite(IconKey); |
| | | var itemCount = PackManager.Instance.GetItemCountByID(PackType.Item, funcSet.CostItemID); |
| | | |
| | | int todayFreeCount = HappyXBModel.Instance.GetFreeCountToday((int)HappXBTitle.Gubao); |
| | | int dayMaxCount = HappyXBModel.Instance.GetDailyFreeCount((int)HappXBTitle.Gubao); |
| | | if (todayFreeCount < dayMaxCount) |
| | | { |
| | | call1Text.text = Language.Get("L1100", Language.Get("L1127"), (dayMaxCount - todayFreeCount) + "/" + dayMaxCount); |
| | | } |
| | | else |
| | | { |
| | | call1Text.text = Language.Get("L1100", item.ItemName, UIHelper.AppendColor(funcSet.CostItemCountList[0] > itemCount ? TextColType.Red : TextColType.LightWhite, funcSet.CostItemCountList[0].ToString())); |
| | | } |
| | | call10Text.text = Language.Get("L1100", item.ItemName, UIHelper.AppendColor(funcSet.CostItemCountList[1] > itemCount ? TextColType.Red : TextColType.LightWhite, funcSet.CostItemCountList[1].ToString())); |
| | | |
| | | |
| | | RefreshFreeTime(); |
| | | |
| | | //再招募{0}次后必得{1}武将 |
| | | List<int> qualityList = new List<int>(); |
| | | var needCount = HappyXBModel.Instance.GetNextXBCountForBigAward((int)HappXBTitle.Gubao, out qualityList); |
| | | List<string> qualityStrList = new List<string>(); |
| | | for (int i = 0; i < qualityList.Count; i++) |
| | | { |
| | | qualityStrList.Add(UIHelper.AppendColor(qualityList[i], Language.Get("L1039", Language.Get("CommonQuality" + qualityList[i])))); |
| | | } |
| | | callTip.text = Language.Get("Gubao12", needCount, string.Join(Language.Get("L1130"), qualityStrList.ToArray())); |
| | | } |
| | | |
| | | //每秒刷新免费CD的倒计时 |
| | | float cdTime = 0; |
| | | |
| | | void LateUpdate() |
| | | { |
| | | //每秒触发一次 |
| | | cdTime += Time.deltaTime; |
| | | if (cdTime < 0.5) return; |
| | | cdTime = 0; |
| | | RefreshFreeTime(); |
| | | if (resultObj.gameObject.activeSelf && !opObj.gameObject.activeSelf) |
| | | { |
| | | if (Time.time - showResultTime > showCD) |
| | | { |
| | | opObj.SetActive(true); |
| | | ShowVenderTalk(GetResultQuality()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | int GetResultQuality() |
| | | { |
| | | if (HappyXBModel.Instance.xbResultDict.IsNullOrEmpty()) |
| | | { |
| | | return 0; |
| | | } |
| | | int quality = 0; |
| | | foreach (var item in HappyXBModel.Instance.xbResultDict.Values) |
| | | { |
| | | int tmp = ItemConfig.Get(item.itemId).ItemColor; |
| | | if (tmp > quality) |
| | | { |
| | | quality = tmp; |
| | | } |
| | | } |
| | | return quality; |
| | | } |
| | | |
| | | void RefreshFreeTime() |
| | | { |
| | | if (HappyXBModel.Instance.IsHaveFreeXB((int)HappXBTitle.Gubao)) |
| | | { |
| | | freeCDTime.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | freeCDTime.SetActive(true); |
| | | freeCDTime.text = Language.Get("L1128", TimeUtility.SecondsToHMS(TimeUtility.GetTodayRemainSeconds())); |
| | | } |
| | | } |
| | | |
| | | void SendGubaoCall() |
| | | { |
| | | if (PackManager.Instance.GetEmptyGridCount(PackType.Item) <= 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("GeRen_chenxin_676165", 2); |
| | | return; |
| | | } |
| | | |
| | | GubaoManager.Instance.selectCallIndex = 0; |
| | | |
| | | if (HappyXBModel.Instance.IsHaveFreeXB((int)HappXBTitle.Gubao)) |
| | | { |
| | | HappyXBModel.Instance.SendXBQuest((int)HappXBTitle.Gubao, 0, 1); |
| | | } |
| | | else |
| | | { |
| | | HappyXBModel.Instance.SendOneXBQuest((int)HappXBTitle.Gubao); |
| | | } |
| | | } |
| | | |
| | | void ShowResult() |
| | | { |
| | | showResultTime = Time.time; |
| | | resultObj.SetActive(true); |
| | | var isSkip = skipToggle.isOn; |
| | | showCD = isSkip ? 0.1f : GubaoManager.Instance.selectCallIndex == 0 ? 1f : 2f; |
| | | |
| | | |
| | | if (GubaoManager.Instance.selectCallIndex == 0) |
| | | { |
| | | oneResultCell.SetActive(true); |
| | | oneResultCell.Display(0).Forget(); |
| | | for (int i = 0; i < tenResultCells.Length; i++) |
| | | { |
| | | tenResultCells[i].SetActive(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | oneResultCell.SetActive(false); |
| | | for (int i = 0; i < tenResultCells.Length; i++) |
| | | { |
| | | tenResultCells[i].SetActive(true); |
| | | tenResultCells[i].Display(i).Forget(); |
| | | } |
| | | } |
| | | |
| | | if (isSkip) |
| | | { |
| | | ShowVenderTalk(GetResultQuality()); |
| | | } |
| | | } |
| | | |
| | | // void clickCallEvent() |
| | | // { |
| | | // if (!skipToggle.isOn) |
| | | // { |
| | | // showResultTime = Time.time + 2; //预设延迟2秒等服务端 |
| | | // opObj.SetActive(false); |
| | | // } |
| | | // } |
| | | |
| | | void ShowRate() |
| | | { |
| | | var config = HappyXBModel.Instance.GetXBItemConfigByType((int)HappXBTitle.Gubao); |
| | | for (int i = 0; i < config.GridItemRateList1.Length; i++) |
| | | { |
| | | //减去上一个从差值才是概率 |
| | | if (i == 0) |
| | | { |
| | | //小数点2位 |
| | | rateTexts[i].text = (config.GridItemRateList1[i][0]/100.0).ToString("0.00") + "%"; |
| | | } |
| | | else |
| | | { |
| | | rateTexts[i].text = ((config.GridItemRateList1[i][0] - config.GridItemRateList1[i - 1][0])/100.0).ToString("0.00") + "%"; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: adfce0ce10dd1f641866ff3f91cafbfa |
| | | 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]; |
| | | DisplayByGBID(gubaoID); |
| | | redImg.SetActive(GubaoManager.Instance.IsRedTip(gubaoID)); |
| | | } |
| | | |
| | | public void Display(int gubaoID) |
| | | { |
| | | DisplayByGBID(gubaoID); |
| | | |
| | | var gbData = GubaoManager.Instance.TryGetGubaoInfo(gubaoID); |
| | | int star = 0; |
| | | if (gbData != null) |
| | | { |
| | | star = gbData.GubaoStar; |
| | | } |
| | | redImg.SetActive(star < 5 && GubaoManager.Instance.CanStarUpGubao(gubaoID)); |
| | | } |
| | | |
| | | void DisplayByGBID(int gubaoID) |
| | | { |
| | | gbBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<GubaoDetailWin>(gubaoID); |
| | | }); |
| | | |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | if (config == null) |
| | | { |
| | | Debug.LogError($"找不到古宝ID: {gubaoID}"); |
| | | return; |
| | | } |
| | | int 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; |
| | | 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, 2); |
| | | }); |
| | | |
| | | seeFullBtn.AddListener(() => |
| | | { |
| | | GubaoManager.Instance.ShowTip(gubaoID, 1); |
| | | }); |
| | | 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); |
| | | Debug.Log($"古宝ID: {gubaoID}"); |
| | | if (config == null) |
| | | { |
| | | Debug.LogError($"找不到古宝ID: {gubaoID}"); |
| | | return; |
| | | } |
| | | |
| | | seeSuiteBtn.SetActive(GubaoResonanceConfig.GetSuiteIDByGubaoID(gubaoID) != 0); |
| | | |
| | | 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) |
| | | { |
| | | if (config.SpecAttrID != 0) |
| | | { |
| | | attrSpecialRects[0].SetActive(true); |
| | | 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 |
| | | { |
| | | attrSpecialRects[0].SetActive(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //有特殊效果的 |
| | | var singleLayerAttrDict = GubaoManager.Instance.GetSpecialAttrSingleLayerByGBID(gubaoID); |
| | | attrSpecialRects[0].SetActive(true); |
| | | 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 const string skipKey = "SkipGBCall"; |
| | | |
| | | public Dictionary<int, int> emojiDict = new Dictionary<int, int>(); //品质:emojiID顺序 |
| | | public int maxIdleTalk = 0; |
| | | |
| | | 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() |
| | | { |
| | | var config = FuncConfigConfig.Get("Gubao1"); |
| | | emojiDict = ConfigParse.ParseIntDict(config.Numerical1); |
| | | maxIdleTalk = int.Parse(config.Numerical2); |
| | | } |
| | | |
| | | |
| | | 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]; |
| | | } |
| | | |
| | | public int GetGubaoTotalCnt() |
| | | { |
| | | return gubaoDict.Count; |
| | | } |
| | | |
| | | // 按选择排序 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> GetBaseMaxAttrByGBID(int gubaoID) |
| | | { |
| | | Dictionary<int, long> attrDict = new Dictionary<int, long>(); |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | var maxStar = GubaoStarConfig.GetMaxStar(config.GubaoQuality); |
| | | for (int i = 0; i < config.BaseAttrIDList.Length; i++) |
| | | { |
| | | attrDict[config.BaseAttrIDList[i]] = config.BaseAttrValueList[i] + config.BaseAttrPerStarAddList[i] * maxStar; |
| | | } |
| | | 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> GetSpecialMaxAttrByGBID(int gubaoID) |
| | | { |
| | | Dictionary<int, long> attrDict = new Dictionary<int, long>(); |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | int quality = config.GubaoQuality; |
| | | var maxStar = GubaoStarConfig.GetMaxStar(config.GubaoQuality); |
| | | var maxLV = GubaoLVAttrConfig.GetMaxLV(quality); |
| | | |
| | | |
| | | attrDict[config.SpecAttrID] = config.SpecAttrValue + config.SpecAttrPerStarAdd * maxStar |
| | | + GubaoLVAttrConfig.GetSpecLVAttrValue(quality, maxLV, config.SpecAttrID); |
| | | |
| | | if (config.SpecEffType != 0) |
| | | { |
| | | attrDict[config.SpecAttrID] *= config.SpecEffLayerMax; |
| | | } |
| | | |
| | | 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 Dictionary<int, int> GetPrivilegeMaxValueByGBID(int gubaoID) |
| | | { |
| | | Dictionary<int, int> attrDict = new Dictionary<int, int>(); |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | var maxStar = GubaoStarConfig.GetMaxStar(config.GubaoQuality); |
| | | attrDict[config.PowerType] = config.PowerValue + config.PowerPerStarAdd * maxStar; |
| | | 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); |
| | | } |
| | | |
| | | //套装星级 -1没激活 |
| | | public int GetSuiteStar(int suiteID) |
| | | { |
| | | var suiteCfg = GubaoResonanceConfig.Get(suiteID); |
| | | int minStar = 999999; //取最小星级 |
| | | foreach (var gubaoID in suiteCfg.GubaoIDList) |
| | | { |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | if (gubaoInfo == null) |
| | | { |
| | | return -1; |
| | | } |
| | | minStar = Math.Min(minStar, gubaoInfo.GubaoStar); |
| | | } |
| | | return GubaoResonanceAttrConfig.GetActiveStar(suiteID, minStar); |
| | | } |
| | | |
| | | public int GetSuiteActiveGBCnt(int suiteID) |
| | | { |
| | | var suiteCfg = GubaoResonanceConfig.Get(suiteID); |
| | | int cnt = 0; |
| | | foreach (var gubaoID in suiteCfg.GubaoIDList) |
| | | { |
| | | var gubaoInfo = TryGetGubaoInfo(gubaoID); |
| | | if (gubaoInfo != null) |
| | | { |
| | | cnt++; |
| | | } |
| | | } |
| | | return cnt; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 鉴宝 |
| | | public event Action clickCallEvent; |
| | | int m_selectCallIndex = 0;//0:1抽 1:10抽 对应配置顺序 |
| | | public int selectCallIndex |
| | | { |
| | | get { return m_selectCallIndex; } |
| | | set |
| | | { |
| | | m_selectCallIndex = value; |
| | | clickCallEvent?.Invoke(); |
| | | } |
| | | } |
| | | #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); //升星 |
| | | |
| | | Redpoint gbCall1RP = new Redpoint(MainRedDot.RedPoint_GuaBao * 10 + 2, (MainRedDot.RedPoint_GuaBao * 10 + 2) * 10 + 1); //1抽 |
| | | Redpoint gbCall10RP = new Redpoint(MainRedDot.RedPoint_GuaBao * 10 + 2, (MainRedDot.RedPoint_GuaBao * 10 + 2) * 10 + 2); //10抽 |
| | | 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.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class GubaoSuiteItemCell : MonoBehaviour |
| | | { |
| | | [SerializeField] ItemCell mainItemCell; |
| | | [SerializeField] Image[] starImgs; |
| | | [SerializeField] Transform processRect; |
| | | [SerializeField] Image processImg; |
| | | [SerializeField] Text processText; |
| | | [SerializeField] Image fullProcessImg; |
| | | |
| | | |
| | | |
| | | public void DisplayByGBID(int gubaoID) |
| | | { |
| | | var config = GubaoConfig.Get(gubaoID); |
| | | if (config == null) |
| | | { |
| | | Debug.LogError($"找不到古宝ID: {gubaoID}"); |
| | | return; |
| | | } |
| | | var gbData = GubaoManager.Instance.TryGetGubaoInfo(gubaoID); |
| | | int lv = 0; |
| | | int star = 0; |
| | | if (gbData != null) |
| | | { |
| | | lv = gbData.GubaoLV; |
| | | star = gbData.GubaoStar; |
| | | } |
| | | mainItemCell.Init(new ItemCellModel(config.UnlockItemID, false, 1)); |
| | | mainItemCell.pieceIcon.SetActive(false); |
| | | mainItemCell.countText.text = lv == 0 ? "" : Language.Get("L1113", lv); |
| | | mainItemCell.button.AddListener(()=> |
| | | { |
| | | GubaoManager.Instance.ShowTip(gubaoID, 1); |
| | | }); |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | if (GubaoManager.Instance.IsMaxStar(gubaoID)) |
| | | { |
| | | processRect.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | var starConfig = GubaoStarConfig.GetConfig(config.GubaoQuality, star + 1); |
| | | if (starConfig.StarUPNeedSelfCnt > 0) |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9e8abe6412cf2a747b9a3ed7b94c2db8 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class GubaoSuiteListCell : CellView |
| | | { |
| | | [SerializeField] GubaoCell[] gubaoCells; |
| | | |
| | | [SerializeField] Text suiteNameText; |
| | | [SerializeField] Text[] suiteAttrTexts; |
| | | [SerializeField] Image[] activeImgs; |
| | | [SerializeField] Image[] lockImgs; |
| | | [SerializeField] Button seeSuiteBtn; |
| | | public void Display(int id) |
| | | { |
| | | var suiteCfg = GubaoResonanceConfig.Get(id); |
| | | suiteNameText.text = suiteCfg.ResonanceName; |
| | | seeSuiteBtn.AddListener(() => |
| | | { |
| | | GubaoManager.Instance.ShowTip(suiteCfg.GubaoIDList[0], 2); |
| | | }); |
| | | |
| | | var config = GubaoResonanceConfig.Get(id); |
| | | for (int i = 0; i < gubaoCells.Length; i++) |
| | | { |
| | | if (i < config.GubaoIDList.Length) |
| | | { |
| | | gubaoCells[i].SetActive(true); |
| | | gubaoCells[i].Display(config.GubaoIDList[i]); |
| | | } |
| | | else |
| | | { |
| | | gubaoCells[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | var curSuiteStar = GubaoManager.Instance.GetSuiteStar(id); |
| | | var tmpStar = curSuiteStar == -1 ? 0 : curSuiteStar; |
| | | var nearSuiteStar = GubaoResonanceAttrConfig.GetNearStar(id, tmpStar); |
| | | var starList = new List<int>() { tmpStar, nearSuiteStar }; |
| | | starList.Sort(); |
| | | |
| | | for (int i = 0; i < suiteAttrTexts.Length; i++) |
| | | { |
| | | string preStr; |
| | | var star = starList[i]; |
| | | var attrCfg = GubaoResonanceAttrConfig.GetConfig(id, star); |
| | | if (star == 0) |
| | | { |
| | | preStr = Language.Get("Gubao27"); |
| | | } |
| | | else |
| | | { |
| | | preStr = Language.Get("Gubao28", star); |
| | | } |
| | | |
| | | |
| | | if (star <= curSuiteStar) |
| | | { |
| | | //激活 |
| | | string format = "{0}" + UIHelper.AppendColor(TextColType.Green, "+{1}", false); |
| | | suiteAttrTexts[i].text = Language.Get("L1100", preStr, PlayerPropertyConfig.GetFullDescription(attrCfg.ResonanceAttrIDList[0], attrCfg.ResonanceAttrValueList[0], format)); |
| | | activeImgs[i].SetActive(true); |
| | | lockImgs[i].SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | //锁定 |
| | | suiteAttrTexts[i].text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("L1100", preStr, PlayerPropertyConfig.GetFullDescription(attrCfg.ResonanceAttrIDList[0], attrCfg.ResonanceAttrValueList[0]))); |
| | | activeImgs[i].SetActive(false); |
| | | lockImgs[i].SetActive(true); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 71612a00de9ad6b4285b2f7ce1a0d3e0 |
| | | 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 GubaoSuiteListWin : UIBase |
| | | { |
| | | [SerializeField] ScrollerController scroller; |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | UIManager.Instance.OnCloseWindow += OnCloseWindow; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | UIManager.Instance.OnCloseWindow -= OnCloseWindow; |
| | | } |
| | | |
| | | void OnCloseWindow(UIBase ui) |
| | | { |
| | | if (ui is GubaoDetailWin) |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | } |
| | | |
| | | |
| | | void Display() |
| | | { |
| | | scroller.Refresh(); |
| | | var keys = GubaoResonanceConfig.GetKeys(); |
| | | for (int i = 0; i < keys.Count; i++) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, keys[i]); |
| | | |
| | | } |
| | | |
| | | scroller.Restart(); |
| | | } |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell as GubaoSuiteListCell; |
| | | _cell.Display(cell.index); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4cea86c782acca946a4c90aa92236f81 |
| | | 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 |
| | | /// 外部查看类型 0完整tip(可切满级) 1 只有基础满级不可切换 2 只有套装 |
| | | /// 内部可切换当前0 和 完整1 |
| | | /// </summary> |
| | | public class GubaoTipWin : UIBase |
| | | { |
| | | [SerializeField] ItemCell mainItemCell; |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] Image[] starImgs; |
| | | [SerializeField] Transform processRect; |
| | | [SerializeField] Image processImg; |
| | | [SerializeField] Text processText; |
| | | [SerializeField] Image fullProcessImg; |
| | | |
| | | |
| | | //基础属性 |
| | | [SerializeField] Text[] attrBaseTexts; |
| | | [SerializeField] Text specialText; //特殊属性和特权效果 |
| | | |
| | | [SerializeField] Button changeBtn; |
| | | [SerializeField] Text changeText; |
| | | [SerializeField] Transform fullRect; |
| | | |
| | | [SerializeField] GubaoSuiteItemCell[] suiteItemCells; |
| | | [SerializeField] Text suiteNameText; |
| | | [SerializeField] Text[] suiteAttrTexts; |
| | | |
| | | [SerializeField] Transform basePanel; |
| | | [SerializeField] Transform linePanel; |
| | | [SerializeField] Transform suitePanel; |
| | | |
| | | int gubaoID = 0; |
| | | bool isFull = false; // 是否显示满级 |
| | | int lv = 0; |
| | | int star = 0; |
| | | int quality = 0; |
| | | GubaoConfig config; |
| | | protected override void InitComponent() |
| | | { |
| | | changeBtn.AddListener(()=> |
| | | { |
| | | isFull = !isFull; |
| | | ShowAttr(); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | gubaoID = functionOrder; |
| | | if (GubaoManager.Instance.tipType == 0) |
| | | { |
| | | isFull = false; |
| | | } |
| | | else if (GubaoManager.Instance.tipType == 1) |
| | | { |
| | | isFull = true; |
| | | } |
| | | Display(); |
| | | } |
| | | |
| | | |
| | | public void Display() |
| | | { |
| | | config = GubaoConfig.Get(gubaoID); |
| | | var gbData = GubaoManager.Instance.TryGetGubaoInfo(gubaoID); |
| | | lv = 0; |
| | | star = 0; |
| | | quality = config.GubaoQuality; |
| | | if (gbData != null) |
| | | { |
| | | lv = gbData.GubaoLV; |
| | | star = gbData.GubaoStar; |
| | | } |
| | | |
| | | /// 外部查看类型 0完整tip(可切满级) 1 只有基础满级不可切换 2 只有套装 |
| | | if (GubaoManager.Instance.tipType == 0) |
| | | { |
| | | basePanel.SetActive(true); |
| | | fullRect.SetActive(false); |
| | | changeBtn.SetActive(true); |
| | | linePanel.SetActive(true); |
| | | ShowBase(); |
| | | ShowSuite(); |
| | | } |
| | | else if (GubaoManager.Instance.tipType == 1) |
| | | { |
| | | basePanel.SetActive(true); |
| | | linePanel.SetActive(false); |
| | | suitePanel.SetActive(false); |
| | | fullRect.SetActive(true); |
| | | changeBtn.SetActive(false); |
| | | ShowBase(); |
| | | |
| | | } |
| | | else if (GubaoManager.Instance.tipType == 2) |
| | | { |
| | | basePanel.SetActive(false); |
| | | linePanel.SetActive(false); |
| | | ShowSuite(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | void ShowBase() |
| | | { |
| | | nameText.text = Language.Get("L1039", Language.Get($"FuncQuality{quality}")) + config.Name; |
| | | nameText.color = UIHelper.GetFuncQualityColor(quality); |
| | | ShowAttr(); |
| | | } |
| | | |
| | | void ShowAttr() |
| | | { |
| | | changeText.text = isFull ? Language.Get("Gubao8") : Language.Get("Gubao9"); |
| | | mainItemCell.Init(new ItemCellModel(config.UnlockItemID, false, 1)); |
| | | mainItemCell.pieceIcon.SetActive(false); |
| | | mainItemCell.countText.text = lv == 0 ? "" : Language.Get("L1113", isFull ? GubaoLVAttrConfig.GetMaxLV(quality) : lv); |
| | | |
| | | if (GubaoManager.Instance.IsMaxStar(gubaoID)) |
| | | { |
| | | processRect.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | var starConfig = GubaoStarConfig.GetConfig(config.GubaoQuality, star + 1); |
| | | if (starConfig.StarUPNeedSelfCnt > 0) |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | int showStar = isFull ? GubaoStarConfig.GetMaxStar(quality) : star; |
| | | for (int i = 0; i < starImgs.Length; i++) |
| | | { |
| | | if (i < showStar) |
| | | { |
| | | starImgs[i].SetActive(true); |
| | | //循环不同图 |
| | | int starIndex = showStar / starImgs.Length * starImgs.Length + i + 1; |
| | | if (starIndex > showStar) |
| | | { |
| | | starIndex -= starImgs.Length; |
| | | } |
| | | starImgs[i].SetSprite($"GubaoStar{starIndex}"); |
| | | } |
| | | else |
| | | { |
| | | starImgs[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | string format = "{0}" + UIHelper.AppendColor(TextColType.Green, "+{1}", false); |
| | | //基础属性 |
| | | var attrDict = !isFull ? GubaoManager.Instance.GetBaseAttrByGBID(gubaoID, true) : GubaoManager.Instance.GetBaseMaxAttrByGBID(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]], format); |
| | | } |
| | | else |
| | | { |
| | | attrBaseTexts[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | //特殊属性和特权只显示一个 |
| | | var specAttrDict = !isFull ? GubaoManager.Instance.GetSpecialAttrByGBID(gubaoID, true) : GubaoManager.Instance.GetSpecialMaxAttrByGBID(gubaoID); |
| | | if (config.SpecEffType == 0 && config.SpecAttrID != 0) |
| | | { |
| | | specialText.text = PlayerPropertyConfig.GetFullDescription(config.SpecAttrID, specAttrDict[config.SpecAttrID], format); |
| | | } |
| | | else if (config.SpecEffType != 0 && config.SpecAttrID != 0) |
| | | { |
| | | //有特殊效果的 |
| | | specialText.text = Language.Get("Gubao22_" + config.SpecEffType) + PlayerPropertyConfig.GetFullDescription(config.SpecAttrID, specAttrDict[config.SpecAttrID], format); |
| | | } |
| | | else |
| | | { |
| | | // 1 游历双倍奖励概率 无 增加万分率 万分率 |
| | | // 2 月卡领取额外奖励 物品ID 提升百分比 百分比 |
| | | |
| | | //有特权效果的 非属性类 |
| | | var valueDict = !isFull ? GubaoManager.Instance.GetPrivilegeValueByGBID(gubaoID, true) : GubaoManager.Instance.GetPrivilegeMaxValueByGBID(gubaoID); |
| | | if (config.PowerType == 1) |
| | | { |
| | | specialText.text = Language.Get("Gubao23_" + config.PowerType, valueDict[config.PowerType] / 100.0); |
| | | } |
| | | else if (config.PowerType == 2) |
| | | { |
| | | specialText.text = Language.Get("Gubao23_" + config.PowerType, ItemConfig.Get(config.PowerTypeValue).ItemName, valueDict[config.PowerType]); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | void ShowSuite() |
| | | { |
| | | var suitID = GubaoResonanceConfig.GetSuiteIDByGubaoID(gubaoID); |
| | | if (suitID == 0) |
| | | { |
| | | suitePanel.SetActive(false); |
| | | linePanel.SetActive(false); |
| | | return; |
| | | } |
| | | suitePanel.SetActive(true); |
| | | var suitConfig = GubaoResonanceConfig.Get(suitID); |
| | | suiteNameText.text = suitConfig.ResonanceName + Language.Get("HeroFates11", GubaoManager.Instance.GetSuiteActiveGBCnt(suitID), suitConfig.GubaoIDList.Length); |
| | | for (int i = 0; i < suiteItemCells.Length; i++) |
| | | { |
| | | if (i < suitConfig.GubaoIDList.Length) |
| | | { |
| | | suiteItemCells[i].SetActive(true); |
| | | suiteItemCells[i].DisplayByGBID(suitConfig.GubaoIDList[i]); |
| | | } |
| | | else |
| | | { |
| | | suiteItemCells[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | var curSuiteStar = GubaoManager.Instance.GetSuiteStar(suitID); |
| | | var starList = GubaoResonanceAttrConfig.GetStarList(suitID); |
| | | |
| | | for (int i = 0; i < suiteAttrTexts.Length; i++) |
| | | { |
| | | string preStr; |
| | | var star = starList[i]; |
| | | var attrCfg = GubaoResonanceAttrConfig.GetConfig(suitID, star); |
| | | if (star == 0) |
| | | { |
| | | preStr = Language.Get("Gubao27"); |
| | | } |
| | | else |
| | | { |
| | | preStr = Language.Get("Gubao28", star); |
| | | } |
| | | |
| | | |
| | | if (star <= curSuiteStar) |
| | | { |
| | | //激活 |
| | | string format = "{0}" + UIHelper.AppendColor(TextColType.Green, "+{1}", false); |
| | | suiteAttrTexts[i].text = Language.Get("L1100", preStr, PlayerPropertyConfig.GetFullDescription(attrCfg.ResonanceAttrIDList[0], attrCfg.ResonanceAttrValueList[0], format)); |
| | | } |
| | | else |
| | | { |
| | | //锁定 |
| | | suiteAttrTexts[i].text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("L1100", preStr, PlayerPropertyConfig.GetFullDescription(attrCfg.ResonanceAttrIDList[0], attrCfg.ResonanceAttrValueList[0]))); |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b1c7ee1650690444ab2c53a1ccd0fd4d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | void OnPlayerLoginOk()
|
| | | {
|
| | | UpdateDonateRedPoint();
|
| | | |
| | |
|
| | | }
|
| | | |
| | |
|
| | | void PlayerDataRefreshEvent(PlayerDataType type)
|
| | | {
|
| | | if(type == PlayerDataType.default33)
|
| | | if (type == PlayerDataType.default33)
|
| | | {
|
| | | UpdateDonateRedPoint();
|
| | | }
|
| | |
| | | familyZBGActions.Clear();
|
| | | sortPlayerCut.Clear();
|
| | | }
|
| | | |
| | |
|
| | | //退出公会
|
| | | public void AfterQuitGuild()
|
| | | {
|
| | |
| | | // zhenbaogeCutState = 0;
|
| | | // familyZBGActions.Clear();
|
| | | // sortPlayerCut.Clear();
|
| | | |
| | |
|
| | | UpdateZBGRedpoint();
|
| | | UpdateDonateRedPoint();
|
| | | EnterOrQuitGuildEvent?.Invoke(false);
|
| | |
| | | public int renameFairyNameMoneyType;
|
| | |
|
| | |
|
| | | |
| | |
|
| | |
|
| | | //珍宝阁(行商)
|
| | | public int zhenbaogeCutState = 0;
|
| | |
| | | public event Action UpdateZhenbaogeEvent;
|
| | | public bool isQueryZBGYet = false;
|
| | | public float lastZBGStartTime = 0; //过天刷新用
|
| | | |
| | |
|
| | | //{id:数据} 砍价行为,value1为玩家ID,特殊约定为1时为家族的数据
|
| | | public Dictionary<int, HA513_tagMCFamilyActionInfo.tagMCFamilyAction> familyZBGActions = new Dictionary<int, HA513_tagMCFamilyActionInfo.tagMCFamilyAction>();
|
| | | public List<int> sortPlayerCut = new List<int>();
|
| | |
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | }
|
| | |
|
| | | public void SendFindGuildNoDecrypt(string msg, int pageIndex = 0, int pageSize = 20)
|
| | | {
|
| | | if (pageIndex == 0)
|
| | | {
|
| | | //默认查询第一页即代表重新开始查询,清空之前的数据
|
| | | guildsDict.Clear();
|
| | | pageIndexList.Clear();
|
| | | }
|
| | | var pack = new CA620_tagCMViewFamilyPage();
|
| | | pack.Msg = msg;
|
| | | pack.MsgLen = (byte)msg.Length;
|
| | | pack.PageIndex = (byte)pageIndex;
|
| | | pack.ShowCount = (byte)pageSize;
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | }
|
| | |
|
| | | public static void SetFairyViewData(FairyData data, HA523_tagMCFamilyViewList.tagMCFamilyView view)
|
| | | {
|
| | |
| | | #endregion
|
| | |
|
| | | #region 珍宝阁
|
| | | |
| | |
|
| | |
|
| | | public void UpdateZhenbaogeInfo(HA512_tagMCFamilyZhenbaogeInfo netPack)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | |
|
| | | public Dictionary <int, FairyMember> tmpNoCutMembers = new Dictionary<int, FairyMember>();
|
| | | public Dictionary<int, FairyMember> tmpNoCutMembers = new Dictionary<int, FairyMember>();
|
| | |
|
| | | //未议价成员
|
| | | public void CalcNoCutMembers()
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | foreach(var playerID in fairy.memberIDList)
|
| | | foreach (var playerID in fairy.memberIDList)
|
| | | {
|
| | | if (!familyZBGActions.ContainsKey(playerID))
|
| | | {
|
| | |
| | |
|
| | |
|
| | | #region 红点
|
| | | |
| | |
|
| | | Redpoint donateRedpoint = new Redpoint(MainRedDot.guildHallRedpointID, MainRedDot.donateRedpointID);
|
| | | //珍宝阁(行商)
|
| | | Redpoint zbgRedpoint = new Redpoint(MainRedDot.MainGuildRedpoint, MainRedDot.hawkerRedpointID);
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | public void UpdateZBGRedpoint()
|
| | | {
|
| | | zbgRedpoint.state = RedPointState.None;
|
| | |
| | | |
| | | fightPowerText.text = UIHelper.ReplaceLargeArtNum(playerInfo.FightPower); |
| | | |
| | | avatarCell.button.AddListener(() => |
| | | avatarCell.AddListener(() => |
| | | { |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(playerID); |
| | | }); |
| | |
| | | SysNotifyMgr.Instance.ShowTip("GuildSys8"); |
| | | }); |
| | | |
| | | leaderAvatar.button.AddListener(() => |
| | | leaderAvatar.AddListener(() => |
| | | { |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(leaderID); |
| | | }); |
| | |
| | |
|
| | | public override void Release()
|
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitialize;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= UpdateFuncState;
|
| | | PackManager.Instance.RefreshItemEvent -= RefreshXBTool;
|
| | | TimeMgr.Instance.OnDayEvent -= OnDayEvent;
|
| | |
| | | public Dictionary<int, XBGetItem> xbResultDict { get; private set; } = new Dictionary<int, XBGetItem>(); //奖品顺序:奖品
|
| | | public void GetServerXBResult(HA350_tagMCTreasureResult result)
|
| | | {
|
| | | int type = result.TreasureType;
|
| | | xbResultDict.Clear();
|
| | | addXBScore = result.AddMoneyValue;
|
| | | addXBScoreType = result.AddMoneyType;
|
| | |
| | | int index = int.Parse(resultData[i][0].ToString());
|
| | | int itemId = int.Parse(resultData[i][1].ToString());
|
| | | int count = int.Parse(resultData[i][2].ToString());
|
| | | bool isOut = int.Parse(resultData[i][3].ToString()) == 1;
|
| | | XBGetItem getItem = new XBGetItem();
|
| | | getItem.SetModel(index, itemId, count);
|
| | | getItem.SetModel(index, itemId, count, isOut);
|
| | | if (!xbResultDict.ContainsKey(i))
|
| | | {
|
| | | xbResultDict.Add(i, getItem);
|
| | |
| | | {
|
| | | RefreshXBResultAct();
|
| | | }
|
| | | if (!UIManager.Instance.IsOpened<HeroCallResultWin>())
|
| | | { |
| | | UIManager.Instance.OpenWindow<HeroCallResultWin>();
|
| | |
|
| | | //武将招募结果是独立界面;古宝是同一个界面用RefreshXBResultAct处理
|
| | | if (type == (int)HappXBTitle.HeroCallAdvanced)
|
| | | {
|
| | | if (!UIManager.Instance.IsOpened<HeroCallResultWin>())
|
| | | {
|
| | | UIManager.Instance.OpenWindow<HeroCallResultWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public int GetNextXBCountForBigAward(int type, out List<int> qualityList)
|
| | | {
|
| | | qualityList = new List<int>();
|
| | |
|
| | | //无配置写死
|
| | | if (type == (int)HappXBTitle.Gubao)
|
| | | {
|
| | | qualityList.Add(3);
|
| | | qualityList.Add(4);
|
| | | }
|
| | | else if (type == (int)HappXBTitle.HeroCallAdvanced)
|
| | | {
|
| | | qualityList.Add(4);
|
| | | qualityList.Add(5);
|
| | | }
|
| | |
|
| | |
|
| | | XBTypeInfo typeInfo = GetXBInfoByType(type);
|
| | | if (typeInfo == null)
|
| | | {
|
| | |
| | | {
|
| | | if (typeInfo.luckValue < luckList[i])
|
| | | {
|
| | | //把二维数组里的所有第二个元素组成新列表
|
| | | qualityList = xbConfig.LuckyItemRateInfo[luckList[i]].Select(x => x[1]).ToList();
|
| | | qualityList.Sort();
|
| | | return luckList[i] - typeInfo.luckValue;
|
| | | }
|
| | | }
|
| | |
| | | public int gridIndex;
|
| | | public int itemId;
|
| | | public int count;
|
| | | public bool isOut; //是否溢出
|
| | | public DateTime createTime;
|
| | |
|
| | | public void SetModel(int index, int id, int count)
|
| | | public void SetModel(int index, int id, int count, bool isOut)
|
| | | {
|
| | | this.gridIndex = index;
|
| | | this.itemId = id;
|
| | | this.count = count;
|
| | | this.isOut = isOut;
|
| | | createTime = TimeUtility.ServerNow;
|
| | | }
|
| | | }
|
| | |
| | | //Store = 3,
|
| | | //Warehouse = 4,
|
| | | GatherSoul = 4, //聚魂寻宝
|
| | | Gubao1 = 5,
|
| | | Gubao2 = 6,
|
| | | Gubao3 = 7,
|
| | | Gubao4 = 8,
|
| | | HeroCallNormal = 11, //11-普通招募
|
| | | Gubao = 5,
|
| | |
|
| | | HeroCallNormal = 11, //11-普通招募 -暂无
|
| | | HeroCallAdvanced = 12, //12-高级招募
|
| | | HeroCallScore = 13, //13-积分招募
|
| | | HeroCallScore = 13, //13-积分招募 -暂无
|
| | | YunShi1 = 105,
|
| | | YunShi2 = 106,
|
| | | YunShi3 = 107,
|
| | |
| | | { |
| | | UIManager.Instance.OpenWindow<BeautyMMBaseWin>(); |
| | | } |
| | | else if (funcID == 28) |
| | | { |
| | | UIManager.Instance.OpenWindow<GubaoBaseWin>(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | }
|
| | | }
|
| | |
|
| | | bool isMergeItem = true;
|
| | | //约定IsBind=10 为古宝额外增加
|
| | | if (netPack.ItemList.Length != 0)
|
| | | {
|
| | | for (int i = 0; i < netPack.ItemLen; i++)
|
| | |
| | | showItems.Add(new Item((int)netPack.ItemList[i].ItemID,
|
| | | netPack.ItemList[i].Count + netPack.ItemList[i].CountEx * Constants.ExpPointValue,
|
| | | netPack.ItemList[i].IsBind));
|
| | | if (isMergeItem && netPack.ItemList[i].IsBind >= 10)
|
| | | {
|
| | | isMergeItem = false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (showItems.Count == 0)
|
| | | return;
|
| | |
|
| | | ItemLogicUtility.Instance.ShowGetItem(showItems, eventName);
|
| | | ItemLogicUtility.Instance.ShowGetItem(showItems, eventName, isMergeItem:isMergeItem);
|
| | | }
|
| | |
|
| | | // public int GetUseCntByID(int itemId)
|
| | |
| | | [SerializeField] LongPressButton btnReduce;
|
| | | [SerializeField] LongPressButton btnPlus;
|
| | | [SerializeField] Transform numForm;
|
| | | [SerializeField] Transform unHaveRect;
|
| | |
|
| | | int itemId;
|
| | | string guid;
|
| | |
| | | btnReduce.SetListener(OnClickReduce);
|
| | | btnReduce.onPress.AddListener(OnClickReduce);
|
| | | }
|
| | |
|
| | | var gbCfg = GubaoConfig.Get(itemId);
|
| | | if (gbCfg != null && !GubaoManager.Instance.IsActive(itemId))
|
| | | {
|
| | | unHaveRect.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | unHaveRect.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | void OnClickPlus()
|
| | |
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | BoxGetItemModel.Instance.countChangeAction -= OnCountChangeAction;
|
| | | scroller.OnRefreshCell -= OnRefreshCell;
|
| | | }
|
| | |
|
| | |
| | | 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 int id; |
| | | public long countEx; |
| | | public int quality; |
| | | public int useType; //用途定义:0 无 1 预留 2 红颜增加 |
| | | public int useType; //用途定义:0 无 1 预留 2 红颜增加 10 古宝增加 |
| | | |
| | | public Item(int _id, long _count) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | public Item(int _id, long _count, int _quality) |
| | | { |
| | | this.id = _id; |
| | | this.quality = _quality; |
| | | this.useType = 0; |
| | | this.countEx = _count; |
| | | } |
| | | |
| | | |
| | | public Item(int _id, long _count, int _useType = 0, int _quality = 0) |
| | | { |
| | |
| | | ItemTipUtility.Show(itemID);
|
| | | });
|
| | |
|
| | | beautyExImg.SetActive(item.useType == 2);
|
| | | beautyExImg.SetActive(item.useType != 0);
|
| | | beautyExImg.SetSprite($"AwardMark{item.useType}");
|
| | | beautyExImg.SetNativeSize();
|
| | | }
|
| | | }
|
| | |
| | |
|
| | |
|
| | |
|
| | |
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
|
| | | }
|
| | |
|
| | |
| | | packScroller.OnRefreshCell -= RefreshPackCell; |
| | | composeScroller.OnRefreshCell -= RefreshComposeCell; |
| | | PackManager.Instance.refrechPackEvent -= RefrechPackEvent; |
| | | PackManager.Instance.RefreshItemEvent -= RefreshItemEvent; |
| | | } |
| | | |
| | | float cdTime = 0f; |
| | |
| | | |
| | | 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 |
| | |
| | | [SerializeField] Button ageWarn; |
| | | [SerializeField] Text verInfo; |
| | | |
| | | [SerializeField] Text m_Banhao; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | base.InitComponent(); |
| | |
| | | |
| | | m_CleanCache.SetListener(CleanCache); |
| | | |
| | | serverRead.SetListener(() => { |
| | | GameAgeWarnWin.data = 1; |
| | | UIManager.Instance.OpenWindow<GameAgeWarnWin>(); |
| | | serverRead.SetListener(() => |
| | | { |
| | | // GameAgeWarnWin.data = 1; |
| | | // UIManager.Instance.OpenWindow<GameAgeWarnWin>(); |
| | | SDKUtils.Instance.OpenUrl(OPConfigConfig.Get("yhxy").content); |
| | | }); |
| | | |
| | | hideRead.SetListener(() => { |
| | | GameAgeWarnWin.data = 2; |
| | | UIManager.Instance.OpenWindow<GameAgeWarnWin>(); |
| | | hideRead.SetListener(() => |
| | | { |
| | | // GameAgeWarnWin.data = 2; |
| | | // UIManager.Instance.OpenWindow<GameAgeWarnWin>(); |
| | | SDKUtils.Instance.OpenUrl(OPConfigConfig.Get("yszc").content); |
| | | }); |
| | | ageWarn.SetListener(() => |
| | | { |
| | |
| | | { |
| | | SDKUtils.Instance.FreePlatformLogin(); |
| | | } |
| | | m_Banhao.text = OPConfigConfig.Get("banhao").content; |
| | | } |
| | | |
| | | protected override void OnOpenAnimationComplete() |
| | |
| | | Directory.Delete(dir, true); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | catch (System.Exception e) |
| | |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | private const string HORSEVALUE_VALUE = "horseValue";
|
| | | private const string BEAUTYVALUE_VALUE = "beautyValue";
|
| | | private const string FATESVALUE_VALUE = "fatesValue";
|
| | | private const string DINGJUNGEVALUE_VALUE = "dingjungeValue";
|
| | | private const string LINEUPHALOPER_VALUE = "lineupHaloPer";
|
| | | private const string REALMPER_VALUE = "realmPer";
|
| | | private const string GUBAOPER_VALUE = "gubaoPer";
|
| | |
| | | private const string STARTALENTPER_VALUE = "starTalentPer";
|
| | | private const string BREAKLVPER_VALUE = "breakLVPer";
|
| | | private const string AWAKETALENTPER_VALUE = "awakeTalentPer";
|
| | | private const string DINGJUNGEPER_VALUE = "dingjungePer";
|
| | | private const string HEROSELFVALUE_VALUE = "heroSelfValue";
|
| | | private const string HEROLVVALUE_VALUE = "heroLVValue";
|
| | | private const string LINEUPHALOVALUE_VALUE = "lineupHaloValue";
|
| | |
| | | private const string PVPDAMPERRATIO_VALUE = "PVPDamPerRatio";
|
| | | private const string PVPDAMPERDEF_VALUE = "PVPDamPerDef";
|
| | | private const string PVPDAMPERDEFRATIO_VALUE = "PVPDamPerDefRatio";
|
| | | private const string GUANCHUAN_VALUE = "Guanchuan";
|
| | | private const string GUANCHUANRATIO_VALUE = "GuanchuanRatio";
|
| | | private const string GUANCHUANDEF_VALUE = "GuanchuanDef";
|
| | | private const string GUANCHUANDEFRATIO_VALUE = "GuanchuanDefRatio";
|
| | | private const string ZHAOJIA_VALUE = "Zhaojia";
|
| | | private const string ZHAOJIARATIO_VALUE = "ZhaojiaRatio";
|
| | | private const string ZHAOJIADEF_VALUE = "ZhaojiaDef";
|
| | | private const string ZHAOJIADEFRATIO_VALUE = "ZhaojiaDefRatio";
|
| | | private const string SKILLPOWER_VALUE = "SkillPower";
|
| | | private const string OFFICIALLV_VALUE = "OfficialLV";
|
| | |
|
| | | // 基础属性公式
|
| | | // (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue+fatesValue)*(1+lineupHaloPer+realmPer+gubaoPer+hjgPer+horsePer+beautyPer+fatesPer+cardPer)*(inheritPer+fetterPer+starTalentPer+breakLVPer+awakeTalentPer)+heroSelfValue+heroLVValue
|
| | | // (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue+fatesValue+dingjungeValue)*(1+lineupHaloPer+realmPer+gubaoPer+hjgPer+horsePer+beautyPer+fatesPer+cardPer)*(inheritPer+fetterPer+starTalentPer+breakLVPer+awakeTalentPer)*(1+dingjungePer)+heroSelfValue+heroLVValue
|
| | | // 战斗属性公式
|
| | | // (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue+fatesValue)+(heroSelfValue+lineupHaloValue+starTalentValue+breakLVValue+awakeTalentValue)+fetterValue
|
| | | // (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue+fatesValue+dingjungeValue)+(heroSelfValue+lineupHaloValue+starTalentValue+breakLVValue+awakeTalentValue)+fetterValue
|
| | | // 战斗力公式
|
| | | // long(Atk*AtkRatio+MaxHP*MaxHPRatio+Def*DefRatio+(StunRate*StunRateRatio+SuperHitRate*SuperHitRateRatio+ComboRate*ComboRateRatio+MissRate*MissRateRatio+ParryRate*ParryRateRatio+SuckHPPer*SuckHPPerRatio+StunRateDef*StunRateDefRatio+SuperHitRateDef*SuperHitRateDefRatio+ComboRateDef*ComboRateDefRatio+MissRateDef*MissRateDefRatio+ParryRateDef*ParryRateDefRatio+SuckHPPerDef*SuckHPPerDefRatio+FinalDamPer*FinalDamPerRatio+FinalDamPerDef*FinalDamPerDefRatio+PhyDamPer*PhyDamPerRatio+PhyDamPerDef*PhyDamPerDefRatio+MagDamPer*MagDamPerRatio+MagDamPerDef*MagDamPerDefRatio+NormalSkillPer*NormalSkillPerRatio+NormalSkillPerDef*NormalSkillPerDefRatio+AngerSkillPer*AngerSkillPerRatio+AngerSkillPerDef*AngerSkillPerDefRatio+SuperDamPer*SuperDamPerRatio+SuperDamPerDef*SuperDamPerDefRatio+CurePer*CurePerRatio+CurePerDef*CurePerDefRatio+ShieldPer*ShieldPerRatio+ShieldPerDef*ShieldPerDefRatio+DOTPer*DOTPerRatio+DOTPerDef*DOTPerDefRatio+WeiFinalDamPer*WeiFinalDamPerRatio+WeiFinalDamPerDef*WeiFinalDamPerDefRatio+ShuFinalDamPer*ShuFinalDamPerRatio+ShuFinalDamPerDef*ShuFinalDamPerDefRatio+WuFinalDamPer*WuFinalDamPerRatio+WuFinalDamPerDef*WuFinalDamPerDefRatio+QunFinalDamPer*QunFinalDamPerRatio+QunFinalDamPerDef*QunFinalDamPerDefRatio+PVPDamPer*PVPDamPerRatio+PVPDamPerDef*PVPDamPerDefRatio)/100.0-55000)
|
| | | // long(Atk*AtkRatio+MaxHP*MaxHPRatio+Def*DefRatio+(StunRate*StunRateRatio+SuperHitRate*SuperHitRateRatio+ComboRate*ComboRateRatio+MissRate*MissRateRatio+ParryRate*ParryRateRatio+SuckHPPer*SuckHPPerRatio+StunRateDef*StunRateDefRatio+SuperHitRateDef*SuperHitRateDefRatio+ComboRateDef*ComboRateDefRatio+MissRateDef*MissRateDefRatio+ParryRateDef*ParryRateDefRatio+SuckHPPerDef*SuckHPPerDefRatio+FinalDamPer*FinalDamPerRatio+FinalDamPerDef*FinalDamPerDefRatio+PhyDamPer*PhyDamPerRatio+PhyDamPerDef*PhyDamPerDefRatio+MagDamPer*MagDamPerRatio+MagDamPerDef*MagDamPerDefRatio+NormalSkillPer*NormalSkillPerRatio+NormalSkillPerDef*NormalSkillPerDefRatio+AngerSkillPer*AngerSkillPerRatio+AngerSkillPerDef*AngerSkillPerDefRatio+SuperDamPer*SuperDamPerRatio+SuperDamPerDef*SuperDamPerDefRatio+CurePer*CurePerRatio+CurePerDef*CurePerDefRatio+ShieldPer*ShieldPerRatio+ShieldPerDef*ShieldPerDefRatio+DOTPer*DOTPerRatio+DOTPerDef*DOTPerDefRatio+WeiFinalDamPer*WeiFinalDamPerRatio+WeiFinalDamPerDef*WeiFinalDamPerDefRatio+ShuFinalDamPer*ShuFinalDamPerRatio+ShuFinalDamPerDef*ShuFinalDamPerDefRatio+WuFinalDamPer*WuFinalDamPerRatio+WuFinalDamPerDef*WuFinalDamPerDefRatio+QunFinalDamPer*QunFinalDamPerRatio+QunFinalDamPerDef*QunFinalDamPerDefRatio+PVPDamPer*PVPDamPerRatio+PVPDamPerDef*PVPDamPerDefRatio+Guanchuan*GuanchuanRatio+GuanchuanDef*GuanchuanDefRatio+Zhaojia*ZhaojiaRatio+ZhaojiaDef*ZhaojiaDefRatio)/100.0-55000)
|
| | | // 技能战斗力公式
|
| | | // SkillPower*OfficialLV
|
| | |
|
| | |
| | | double horseValue = variables[HORSEVALUE_VALUE];
|
| | | double beautyValue = variables[BEAUTYVALUE_VALUE];
|
| | | double fatesValue = variables[FATESVALUE_VALUE];
|
| | | double dingjungeValue = variables[DINGJUNGEVALUE_VALUE];
|
| | | double lineupHaloPer = variables[LINEUPHALOPER_VALUE];
|
| | | double realmPer = variables[REALMPER_VALUE];
|
| | | double gubaoPer = variables[GUBAOPER_VALUE];
|
| | |
| | | double starTalentPer = variables[STARTALENTPER_VALUE];
|
| | | double breakLVPer = variables[BREAKLVPER_VALUE];
|
| | | double awakeTalentPer = variables[AWAKETALENTPER_VALUE];
|
| | | double dingjungePer = variables[DINGJUNGEPER_VALUE];
|
| | | double heroSelfValue = variables[HEROSELFVALUE_VALUE];
|
| | | double heroLVValue = variables[HEROLVVALUE_VALUE];
|
| | |
|
| | | return (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue+fatesValue)*(1+lineupHaloPer+realmPer+gubaoPer+hjgPer+horsePer+beautyPer+fatesPer+cardPer)*(inheritPer+fetterPer+starTalentPer+breakLVPer+awakeTalentPer)+heroSelfValue+heroLVValue;
|
| | | return (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue+fatesValue+dingjungeValue)*(1+lineupHaloPer+realmPer+gubaoPer+hjgPer+horsePer+beautyPer+fatesPer+cardPer)*(inheritPer+fetterPer+starTalentPer+breakLVPer+awakeTalentPer)*(1+dingjungePer)+heroSelfValue+heroLVValue;
|
| | | }
|
| | |
|
| | | public static double GetFightAttr(Dictionary<string, double> variables)
|
| | |
| | | double horseValue = variables[HORSEVALUE_VALUE];
|
| | | double beautyValue = variables[BEAUTYVALUE_VALUE];
|
| | | double fatesValue = variables[FATESVALUE_VALUE];
|
| | | double dingjungeValue = variables[DINGJUNGEVALUE_VALUE];
|
| | | double heroSelfValue = variables[HEROSELFVALUE_VALUE];
|
| | | double lineupHaloValue = variables[LINEUPHALOVALUE_VALUE];
|
| | | double starTalentValue = variables[STARTALENTVALUE_VALUE];
|
| | |
| | | double awakeTalentValue = variables[AWAKETALENTVALUE_VALUE];
|
| | | double fetterValue = variables[FETTERVALUE_VALUE];
|
| | |
|
| | | return (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue+fatesValue)+(heroSelfValue+lineupHaloValue+starTalentValue+breakLVValue+awakeTalentValue)+fetterValue;
|
| | | return (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue+fatesValue+dingjungeValue)+(heroSelfValue+lineupHaloValue+starTalentValue+breakLVValue+awakeTalentValue)+fetterValue;
|
| | | }
|
| | |
|
| | | public static double GetFightPower(Dictionary<string, double> variables)
|
| | |
| | | double PVPDamPerRatio = variables[PVPDAMPERRATIO_VALUE];
|
| | | double PVPDamPerDef = variables[PVPDAMPERDEF_VALUE];
|
| | | double PVPDamPerDefRatio = variables[PVPDAMPERDEFRATIO_VALUE];
|
| | | double Guanchuan = variables[GUANCHUAN_VALUE];
|
| | | double GuanchuanRatio = variables[GUANCHUANRATIO_VALUE];
|
| | | double GuanchuanDef = variables[GUANCHUANDEF_VALUE];
|
| | | double GuanchuanDefRatio = variables[GUANCHUANDEFRATIO_VALUE];
|
| | | double Zhaojia = variables[ZHAOJIA_VALUE];
|
| | | double ZhaojiaRatio = variables[ZHAOJIARATIO_VALUE];
|
| | | double ZhaojiaDef = variables[ZHAOJIADEF_VALUE];
|
| | | double ZhaojiaDefRatio = variables[ZHAOJIADEFRATIO_VALUE];
|
| | |
|
| | | return (long)(Atk*AtkRatio+MaxHP*MaxHPRatio+Def*DefRatio+(StunRate*StunRateRatio+SuperHitRate*SuperHitRateRatio+ComboRate*ComboRateRatio+MissRate*MissRateRatio+ParryRate*ParryRateRatio+SuckHPPer*SuckHPPerRatio+StunRateDef*StunRateDefRatio+SuperHitRateDef*SuperHitRateDefRatio+ComboRateDef*ComboRateDefRatio+MissRateDef*MissRateDefRatio+ParryRateDef*ParryRateDefRatio+SuckHPPerDef*SuckHPPerDefRatio+FinalDamPer*FinalDamPerRatio+FinalDamPerDef*FinalDamPerDefRatio+PhyDamPer*PhyDamPerRatio+PhyDamPerDef*PhyDamPerDefRatio+MagDamPer*MagDamPerRatio+MagDamPerDef*MagDamPerDefRatio+NormalSkillPer*NormalSkillPerRatio+NormalSkillPerDef*NormalSkillPerDefRatio+AngerSkillPer*AngerSkillPerRatio+AngerSkillPerDef*AngerSkillPerDefRatio+SuperDamPer*SuperDamPerRatio+SuperDamPerDef*SuperDamPerDefRatio+CurePer*CurePerRatio+CurePerDef*CurePerDefRatio+ShieldPer*ShieldPerRatio+ShieldPerDef*ShieldPerDefRatio+DOTPer*DOTPerRatio+DOTPerDef*DOTPerDefRatio+WeiFinalDamPer*WeiFinalDamPerRatio+WeiFinalDamPerDef*WeiFinalDamPerDefRatio+ShuFinalDamPer*ShuFinalDamPerRatio+ShuFinalDamPerDef*ShuFinalDamPerDefRatio+WuFinalDamPer*WuFinalDamPerRatio+WuFinalDamPerDef*WuFinalDamPerDefRatio+QunFinalDamPer*QunFinalDamPerRatio+QunFinalDamPerDef*QunFinalDamPerDefRatio+PVPDamPer*PVPDamPerRatio+PVPDamPerDef*PVPDamPerDefRatio)/100.0-55000);
|
| | | return (long)(Atk*AtkRatio+MaxHP*MaxHPRatio+Def*DefRatio+(StunRate*StunRateRatio+SuperHitRate*SuperHitRateRatio+ComboRate*ComboRateRatio+MissRate*MissRateRatio+ParryRate*ParryRateRatio+SuckHPPer*SuckHPPerRatio+StunRateDef*StunRateDefRatio+SuperHitRateDef*SuperHitRateDefRatio+ComboRateDef*ComboRateDefRatio+MissRateDef*MissRateDefRatio+ParryRateDef*ParryRateDefRatio+SuckHPPerDef*SuckHPPerDefRatio+FinalDamPer*FinalDamPerRatio+FinalDamPerDef*FinalDamPerDefRatio+PhyDamPer*PhyDamPerRatio+PhyDamPerDef*PhyDamPerDefRatio+MagDamPer*MagDamPerRatio+MagDamPerDef*MagDamPerDefRatio+NormalSkillPer*NormalSkillPerRatio+NormalSkillPerDef*NormalSkillPerDefRatio+AngerSkillPer*AngerSkillPerRatio+AngerSkillPerDef*AngerSkillPerDefRatio+SuperDamPer*SuperDamPerRatio+SuperDamPerDef*SuperDamPerDefRatio+CurePer*CurePerRatio+CurePerDef*CurePerDefRatio+ShieldPer*ShieldPerRatio+ShieldPerDef*ShieldPerDefRatio+DOTPer*DOTPerRatio+DOTPerDef*DOTPerDefRatio+WeiFinalDamPer*WeiFinalDamPerRatio+WeiFinalDamPerDef*WeiFinalDamPerDefRatio+ShuFinalDamPer*ShuFinalDamPerRatio+ShuFinalDamPerDef*ShuFinalDamPerDefRatio+WuFinalDamPer*WuFinalDamPerRatio+WuFinalDamPerDef*WuFinalDamPerDefRatio+QunFinalDamPer*QunFinalDamPerRatio+QunFinalDamPerDef*QunFinalDamPerDefRatio+PVPDamPer*PVPDamPerRatio+PVPDamPerDef*PVPDamPerDefRatio+Guanchuan*GuanchuanRatio+GuanchuanDef*GuanchuanDefRatio+Zhaojia*ZhaojiaRatio+ZhaojiaDef*ZhaojiaDefRatio)/100.0-55000);
|
| | | }
|
| | |
|
| | | public static double GetSkillsFightPower(Dictionary<string, double> variables)
|
| | |
| | | private const string HERO_LV_VALUE = "heroLVValue"; |
| | | private const string HERO_LV_PER = "heroLVPer"; |
| | | private const string HERO_CARDPER = "cardPer"; |
| | | private const string DINGJUNGE_VALUE = "dingjungeValue"; |
| | | private const string DINGJUNGE_PER = "dingjungePer"; |
| | | |
| | | // 战力变量常量 |
| | | private const string ATK_RATIO = "AtkRatio"; |
| | |
| | | private const string CURE_PER_DEF_RATIO = "CurePerDefRatio"; |
| | | private const string PVP_DAM_PER_RATIO = "PVPDamPerRatio"; |
| | | private const string PVP_DAM_PER_DEF_RATIO = "PVPDamPerDefRatio"; |
| | | private const string GUANCHUAN_RATIO = "GuanchuanRatio"; |
| | | private const string GUANCHUAN_DEF_RATIO = "GuanchuanDefRatio"; |
| | | private const string ZHAOJIA_RATIO = "ZhaojiaRatio"; |
| | | private const string ZHAOJIA_DEF_RATIO = "ZhaojiaDefRatio"; |
| | | |
| | | |
| | | private const string PLAYER_LV = "PlayerLV"; |
| | | private const string OFFICIAL_LV = "OfficialLV"; |
| | | private const string SKILL_POWER = "SkillPower"; |
| | |
| | | propertyVariables[BEAUTY_PER] = BeautyMMManager.Instance.GetAttrPer(attrType) / 10000.0f; |
| | | propertyVariables[FATES_VALUE] = HeroFatesManager.Instance.GetAttrValue(attrType); |
| | | propertyVariables[FATES_PER] = HeroFatesManager.Instance.GetAttrPer(attrType) / 10000.0f; |
| | | propertyVariables[DINGJUNGE_VALUE] = 0; //默认不需要加,爬塔特殊用,配合公式 |
| | | propertyVariables[DINGJUNGE_PER] = 0; //默认不需要加,爬塔特殊用,配合公式 |
| | | |
| | | |
| | | //全体卡牌加成 |
| | | propertyVariables[HERO_CARDPER] = allHeroAddPer; |
| | |
| | | fightPowerVariables[CURE_PER_DEF_RATIO] = fightPowerRatioConfig.CurePerDefRatio; |
| | | fightPowerVariables[PVP_DAM_PER_RATIO] = fightPowerRatioConfig.PVPDamPerRatio; |
| | | fightPowerVariables[PVP_DAM_PER_DEF_RATIO] = fightPowerRatioConfig.PVPDamPerDefRatio; |
| | | fightPowerVariables[GUANCHUAN_RATIO] = fightPowerRatioConfig.GuanchuanRatio; |
| | | fightPowerVariables[GUANCHUAN_DEF_RATIO] = fightPowerRatioConfig.GuanchuanDefRatio; |
| | | fightPowerVariables[ZHAOJIA_RATIO] = fightPowerRatioConfig.ZhaojiaRatio; |
| | | fightPowerVariables[ZHAOJIA_DEF_RATIO] = fightPowerRatioConfig.ZhaojiaDefRatio; |
| | | |
| | | |
| | | long fightPower = (long)FightPowerFormula.GetFightPower(fightPowerVariables); |
| | | #if UNITY_EDITOR |
| | |
| | | { |
| | | taskEffect.Stop(); |
| | | } |
| | | var config = ItemConfig.Get(taskConfig.AwardItemList[0][0]); |
| | | awardIcon.SetOrgSprite(ItemConfig.Get(taskConfig.AwardItemList[0][0]).IconKey, GeneralDefine.itemIconDict.ContainsKey(config.Type) ? GeneralDefine.itemIconDict[config.Type] : "icon"); |
| | | |
| | | awardIcon.SetItemSprite(taskConfig.AwardItemList[0][0]); |
| | | awardCnt.text = taskConfig.AwardItemList[0][1].ToString(); |
| | | } |
| | | } |
| | |
| | | { |
| | | base.InitComponent(); |
| | | avatarCell.redpoint.redpointId = MainRedDot.PhantasmPavilionRepoint; |
| | | avatarCell.button.SetListener(() => |
| | | avatarCell.SetListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<PlayerProfileWin>(); |
| | | }); |
| | |
| | | ShowFuncCol(false); |
| | | }); |
| | | |
| | | UIManager.Instance.OnCloseWindow -= OnCloseWindow; |
| | | |
| | | UIManager.Instance.OnCloseWindow += OnCloseWindow; |
| | | |
| | | dayMissionBtn.AddListener(() => |
| | |
| | | UIManager.Instance.OpenWindow<FunctionPreviewWin>(); |
| | | }); |
| | | } |
| | | |
| | | void OnDestroy() |
| | | { |
| | | UIManager.Instance.OnCloseWindow -= OnCloseWindow; |
| | | } |
| | | |
| | | |
| | | void ShowBtns() |
| | | { |
| | |
| | | // 初始化组件 |
| | | m_ContainerNormalHint.OnWaitCompelete(OnHintDisplayComplete); |
| | | m_ContainerChatHint.OnWaitCompelete(OnHintDisplayComplete); |
| | | m_ScrollControl.OnRefreshCell += OnRefreshGmCell; |
| | | m_ScrollControl.OnGetDynamicSize += OnGetDynamicSize; |
| | | |
| | | m_ScrollControl.lockType = EnhanceLockType.LockVerticalBottom; |
| | | m_GMClose.onClick.AddListener(OnGMClose); |
| | | } |
| | |
| | | ServerTipDetails.gmMessageRefresh += DisplayGM; |
| | | ServerTipDetails.gmOpenEvent += GmOpenEvent; |
| | | ServerTipDetails.chatHintRefresh += CheckChatHint; |
| | | m_ScrollControl.OnRefreshCell += OnRefreshGmCell; |
| | | m_ScrollControl.OnGetDynamicSize += OnGetDynamicSize; |
| | | CheckNormalHint(); |
| | | CheckChatHint(); |
| | | CheckServerHint(); |
| | |
| | | ServerTipDetails.gmMessageRefresh -= DisplayGM; |
| | | ServerTipDetails.gmOpenEvent -= GmOpenEvent; |
| | | ServerTipDetails.chatHintRefresh -= CheckChatHint; |
| | | // 窗口关闭时的逻辑 |
| | | m_ScrollControl.OnRefreshCell -= OnRefreshGmCell; |
| | | m_ScrollControl.OnGetDynamicSize -= OnGetDynamicSize; |
| | | |
| | | } |
| | | |
| | |
| | |
|
| | | public OpenServerActivityCenter()
|
| | | {
|
| | | TimeUtility.OnServerOpenDayRefresh -= OnServerOpenDayRefresh;
|
| | | TimeUtility.OnServerOpenDayRefresh += OnServerOpenDayRefresh;
|
| | | }
|
| | |
|
| | |
| | | if (!openServerActivitys.ContainsKey(funcOrder))
|
| | | {
|
| | | openServerActivitys.Add(funcOrder, activity);
|
| | | activity.onStateUpdate -= OnStateUpdate;
|
| | | activity.onStateUpdate += OnStateUpdate;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | public OperationTimeHepler()
|
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerDataInitializeEvent;
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | TimeMgr.Instance.OnHourEvent -= HourEvent;
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent;
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | TimeMgr.Instance.OnHourEvent += HourEvent;
|
copy from Main/System/RoleParticulars.meta
copy to Main/System/OtherPlayerDetail.meta
| File was copied from Main/System/RoleParticulars.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7f4be2a6d73bb8c40b77b85620ca4026 |
| | | guid: 776fe4907b83bde4eb75533ee79ae268 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class OtherEquipCardItem : MonoBehaviour |
| | | { |
| | | [SerializeField] Button btnClick; |
| | | [SerializeField] Image imgQuality; //装备的底图,不同品质颜色 |
| | | [SerializeField] Image imgNull; //空装备的部位图标 |
| | | [SerializeField] Image imgIcon; //装备图标 |
| | | [SerializeField] UIEffectPlayer uiEffect; |
| | | [SerializeField] Text txtLv; |
| | | OtherPlayerDetailManager manager { get { return OtherPlayerDetailManager.Instance; } } |
| | | public void Display(OtherPlayerDetailManager.RolePlusData.EquipData equip) |
| | | { |
| | | |
| | | if (equip == null || !ItemConfig.HasKey(equip.ItemID)) |
| | | { |
| | | imgQuality.SetSprite("equipQuality0"); |
| | | imgNull.SetActive(true); |
| | | imgIcon.SetActive(false); |
| | | uiEffect.Stop(); |
| | | txtLv.text = string.Empty; |
| | | return; |
| | | } |
| | | ItemConfig config = ItemConfig.Get(equip.ItemID); |
| | | |
| | | imgNull.SetActive(false); |
| | | imgIcon.SetActive(true); |
| | | imgQuality.SetSprite("equipQuality" + config.ItemColor); |
| | | imgIcon.SetOrgSprite(config.IconKey); |
| | | txtLv.text = Language.Get("L1113", manager.GetEquipLV(equip)); |
| | | |
| | | if (config.ItemColor >= 7) |
| | | { |
| | | uiEffect.effectId = 1026; |
| | | |
| | | uiEffect.PlayByArrIndex(config.ItemColor - 7, true, true); |
| | | } |
| | | else |
| | | { |
| | | uiEffect.Stop(); |
| | | } |
| | | |
| | | // //特效参考尺寸106*150 同比例缩放 |
| | | var rect = this.transform.GetComponent<RectTransform>(); |
| | | uiEffect.transform.localScale = new Vector3(rect.sizeDelta.x / 106f, rect.sizeDelta.y / 150f, 1); |
| | | |
| | | btnClick.SetListener(() => |
| | | { |
| | | manager.equip = equip; |
| | | if (!UIManager.Instance.IsOpened<OtherEquipTipWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindow<OtherEquipTipWin>(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fc508978e84be984fafbe320e2dd0f8d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Cysharp.Threading.Tasks; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | //装备TIP界面 |
| | | public class OtherEquipTipWin : UIBase |
| | | { |
| | | [SerializeField] Image equipImage; |
| | | [SerializeField] Text itemName; |
| | | [SerializeField] OutlineEx itemNameOutline; |
| | | [SerializeField] Text qualityName; |
| | | [SerializeField] OutlineEx qualityNameOutline; |
| | | [SerializeField] Text placeName; |
| | | [SerializeField] Text lvText; |
| | | [SerializeField] Image bgFlower; //背景花纹变色 |
| | | [SerializeField] List<Text> baseAttrNames; |
| | | [SerializeField] List<Text> baseAttrValues; |
| | | [SerializeField] GameObject fightAttrGameObj; |
| | | [SerializeField] List<GameObject> fightAttrLine; |
| | | [SerializeField] List<Text> fightAttrNames; |
| | | [SerializeField] List<Text> fightAttrValues; |
| | | |
| | | [SerializeField] UIEffectPlayer uieffect; |
| | | [SerializeField] RectTransform bgRect; |
| | | int equipID; |
| | | ItemConfig itemConfig; |
| | | OtherPlayerDetailManager.RolePlusData.EquipData equip; |
| | | OtherPlayerDetailManager manager { get { return OtherPlayerDetailManager.Instance; } } |
| | | protected override void OnPreOpen() |
| | | { |
| | | equip = manager.equip; |
| | | if (equip == null) |
| | | { |
| | | DelayCloseWindow().Forget(); |
| | | return; |
| | | } |
| | | equipID = equip.ItemID; |
| | | if (!ItemConfig.HasKey(equipID)) |
| | | { |
| | | DelayCloseWindow().Forget(); |
| | | return; |
| | | } |
| | | itemConfig = ItemConfig.Get(equipID); |
| | | Display(itemConfig); |
| | | } |
| | | |
| | | protected override void OnOpen() |
| | | { |
| | | //先缩小,这样不会因为间隔帧产生明显的闪烁 |
| | | uieffect.transform.localScale = Vector3.zero; |
| | | //特效显示依赖rect的排版,放在下一帧 |
| | | RefreshEffect(itemConfig.ItemColor).Forget(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | } |
| | | |
| | | public void Display(ItemConfig config) |
| | | { |
| | | |
| | | equipImage.SetOrgSprite(config.IconKey); |
| | | itemName.text = UIHelper.AppendColor(config.ItemColor, config.ItemName, true, 1); |
| | | itemNameOutline.OutlineColor = UIHelper.GetUIOutlineColor(config.ItemColor); |
| | | qualityName.text = UIHelper.GetQualityNameWithColor(config.ItemColor, Language.Get("L1039")); |
| | | qualityNameOutline.OutlineColor = UIHelper.GetUIOutlineColor(config.ItemColor); |
| | | placeName.text = EquipModel.Instance.GetEquipPlaceName(config.EquipPlace); |
| | | lvText.text = Language.Get("EquipExchangeWin7", manager.GetEquipLV(equip)); |
| | | bgFlower.color = UIHelper.GetUIColor(config.ItemColor); |
| | | |
| | | var baseAttrs = manager.GetEquipBaseAttrs(equip); |
| | | var baseValues = manager.GetEquipBaseValues(equip); |
| | | var fightAttrs = manager.GetEquipFightAttrs(equip); |
| | | var fightValues = manager.GetEquipFightValues(equip); |
| | | |
| | | for (var i = 0; i < baseAttrNames.Count; i++) |
| | | { |
| | | if (i >= baseAttrs.Count) |
| | | { |
| | | baseAttrNames[i].text = ""; |
| | | baseAttrValues[i].text = ""; |
| | | } |
| | | else |
| | | { |
| | | baseAttrNames[i].text = PlayerPropertyConfig.Get(baseAttrs[i]).Name; |
| | | baseAttrValues[i].text = PlayerPropertyConfig.GetValueDescription(baseAttrs[i], baseValues[i]); |
| | | } |
| | | } |
| | | |
| | | if (fightAttrs.IsNullOrEmpty()) |
| | | { |
| | | fightAttrGameObj.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | fightAttrGameObj.SetActive(true); |
| | | for (var i = 0; i < fightAttrNames.Count; i++) |
| | | { |
| | | if (i >= fightAttrs.Count) |
| | | { |
| | | fightAttrNames[i].SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | fightAttrNames[i].SetActive(true); |
| | | fightAttrNames[i].text = PlayerPropertyConfig.Get(fightAttrs[i]).Name; |
| | | fightAttrValues[i].text = PlayerPropertyConfig.GetValueDescription(fightAttrs[i], fightValues[i]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //延迟处理特效大小 |
| | | async UniTask RefreshEffect(int itemColor) |
| | | { |
| | | await UniTask.DelayFrame(3); |
| | | int effectID = EquipModel.Instance.equipUIEffects[Math.Min(itemColor, EquipModel.Instance.equipUIEffects.Length) - 1]; |
| | | if (effectID == 0) |
| | | { |
| | | uieffect.Stop(); |
| | | } |
| | | else |
| | | { |
| | | uieffect.effectId = effectID; |
| | | //计算高度缩放比例 特效显示依赖rect的排版 |
| | | uieffect.transform.localScale = new Vector3(0.98f, bgRect.rect.height / uieffect.GetComponent<RectTransform>().rect.height, 1); |
| | | uieffect.Play(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b22e83cf6038bb54c9b27407690ace89 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using Cysharp.Threading.Tasks; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class OtherHeroDetailWin : UIBase |
| | | { |
| | | [SerializeField] SkillBaseCell normalSkillCell; |
| | | [SerializeField] SkillBaseCell angerSkillCell; |
| | | [SerializeField] HeroShowBaseCell heroShow; |
| | | [SerializeField] ButtonEx btnTotalAttr; |
| | | [SerializeField] TextEx[] attrs; |
| | | [SerializeField] GiftBaseCell[] giftBaseCells; //天赋 |
| | | [SerializeField] ScrollRect allAttrScroll; //培养属性 滚动区 |
| | | [SerializeField] GameObject fetterGo; |
| | | [SerializeField] Text[] fetterText; //羁绊 |
| | | [SerializeField] Text[] fetterNameText; //羁绊 |
| | | |
| | | [SerializeField] GameObject potential; |
| | | [SerializeField] GameObject potentialCell; //潜能和觉醒用于创建 |
| | | [SerializeField] Transform potentialCellParent; //潜能父节点 |
| | | [SerializeField] Transform awakeCellParent; //潜能父节点 |
| | | [SerializeField] GameObject awakeGo; |
| | | |
| | | OtherPlayerDetailManager.RolePlusData.HeroData heroData; |
| | | List<OtherPlayerDetailManager.RolePlusData.HeroData> heroDatas; |
| | | Dictionary<int, long> attrDict; |
| | | OtherPlayerDetailManager manager { get { return OtherPlayerDetailManager.Instance; } } |
| | | protected override void InitComponent() |
| | | { |
| | | awakeCellList = new List<GameObject>(); |
| | | potentialCellList = new List<GameObject>(); |
| | | btnTotalAttr.SetListener(() => { AttributeManager.Instance.OpenTotalAttributeWin(attrDict); }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | // 重置所有滚动区到顶部 |
| | | if (allAttrScroll != null) |
| | | { |
| | | allAttrScroll.verticalNormalizedPosition = 1f; |
| | | } |
| | | |
| | | heroData = manager.heroData; |
| | | heroDatas = manager.heroDatas; |
| | | attrDict = heroData.AttrDict; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | |
| | | } |
| | | |
| | | private void Display() |
| | | { |
| | | if (heroDatas.IsNullOrEmpty() || heroData == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | int heroID = heroData.HeroID; |
| | | if (!HeroConfig.HasKey(heroID)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | HeroConfig heroConfig = HeroConfig.Get(heroID); |
| | | |
| | | int skinID = heroData.SkinID; |
| | | int lv = heroData.LV; |
| | | int star = heroData.Star; |
| | | int quality = heroConfig.Quality; |
| | | int breakLevel = manager.GetBreakLevel(heroData); |
| | | int awakeLevel = manager.GetAwakeLevel(heroData); |
| | | int atkSkillID = heroConfig.AtkSkillID; |
| | | int angerSkillID = heroConfig.AngerSkillID; |
| | | List<int> talentIDList = manager.GetTalentIDList(heroData); |
| | | List<int> talentLvList = manager.GetTalentLvList(heroData); |
| | | int[] FetterIDList = heroConfig.FetterIDList; |
| | | |
| | | DisplaySkill(heroID, atkSkillID, angerSkillID); |
| | | DisplayHeroShow(heroID, skinID, breakLevel, star, awakeLevel, lv); |
| | | DisplayAttr(heroData); |
| | | DisplayGiftBaseCell(heroID, awakeLevel, talentIDList, talentLvList); |
| | | DisplayFetter(heroDatas, FetterIDList); |
| | | DisplayPotential(heroID, breakLevel); |
| | | RefreshAwake(heroID, quality, awakeLevel); |
| | | |
| | | ForceRefreshLayout(); |
| | | } |
| | | |
| | | List<GameObject> awakeCellList; //觉醒 |
| | | void RefreshAwake(int heroID, int quality, int awakeLevel) |
| | | { |
| | | |
| | | if (!HeroAwakeConfig.CanAwake(heroID, 1)) |
| | | { |
| | | awakeGo.SetActive(false); |
| | | return; |
| | | } |
| | | awakeGo.SetActive(true); |
| | | |
| | | var maxLV = HeroAwakeConfig.GetMaxAwakeLV(heroID); |
| | | var starCnt = HeroQualityConfig.Get(quality).InitStarUpper; |
| | | for (int i = 1; i <= maxLV; i++) |
| | | { |
| | | if (i > awakeCellList.Count) |
| | | { |
| | | awakeCellList.Add(Instantiate(potentialCell, awakeCellParent)); |
| | | } |
| | | var go = awakeCellList[i - 1]; |
| | | var descText = go.GetComponent<Text>(); |
| | | var nameText = go.GetComponent<Text>("skillname"); |
| | | go.SetActive(true); |
| | | |
| | | var config = HeroAwakeConfig.GetHeroAwakeConfig(heroID, i); |
| | | |
| | | int type = config.UnlockTalentSlot != 0 ? 1 : config.SkillID != 0 ? 2 : 3; |
| | | var awakeStr = string.Empty; |
| | | if (type == 1) |
| | | { |
| | | starCnt += config.AddStarUpper; |
| | | awakeStr = Language.Get("HeroAwake8", config.UnlockTalentSlot, starCnt); |
| | | } |
| | | else if (type == 2) |
| | | { |
| | | var skill = SkillConfig.Get(config.SkillID); |
| | | if (skill != null) |
| | | { |
| | | awakeStr = Language.Get("L1039", skill.SkillName) + skill.Description; |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError($"heroId:{heroID} 觉醒技能ID:{config.SkillID} 配置错误技能不存在"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int k = 0; k < config.AttrIDList.Length; k++) |
| | | { |
| | | awakeStr += (string.IsNullOrEmpty(config.SkillIName) ? string.Empty : Language.Get("L1039", config.SkillIName)) + |
| | | PlayerPropertyConfig.GetFullDescription(config.AttrIDList[k], config.AttrValueList[k], "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}")) |
| | | + (k == config.AttrIDList.Length - 1 ? "" : "\n"); |
| | | } |
| | | } |
| | | |
| | | if (i - 1 < awakeLevel) |
| | | { |
| | | nameText.text = Language.Get("herocard12", i) + Language.Get("L1096"); |
| | | descText.text = awakeStr; |
| | | } |
| | | else |
| | | { |
| | | //置灰 |
| | | nameText.text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard12", i) + Language.Get("L1096")); |
| | | descText.text = UIHelper.AppendColor(TextColType.NavyGray, UIHelper.RemoveColor(awakeStr)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<GameObject> potentialCellList; //潜能 |
| | | void DisplayPotential(int heroID, int breakLevel) |
| | | { |
| | | if (!HeroBreakConfig.configDics.ContainsKey(heroID)) |
| | | return; |
| | | |
| | | var list = HeroBreakConfig.configDics[heroID].Keys.ToList(); |
| | | |
| | | list.Sort(); |
| | | |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | var nextQualityBreakConfig = HeroBreakConfig.GetHeroBreakConfig(heroID, i + 1); |
| | | if (nextQualityBreakConfig == null) |
| | | break; |
| | | List<string> attrStrArr = new List<string>(); |
| | | for (int j = 0; j < nextQualityBreakConfig.AttrIDList.Length; j++) |
| | | { |
| | | if (nextQualityBreakConfig.AttrIDList[j] == 0) |
| | | continue; |
| | | string format = i < breakLevel ? "{0}" + UIHelper.AppendColor(TextColType.Green, "+{1}") : "{0}+{1}"; |
| | | attrStrArr.Add((string.IsNullOrEmpty(nextQualityBreakConfig.SkillIName) ? string.Empty : Language.Get("L1039", nextQualityBreakConfig.SkillIName)) + |
| | | PlayerPropertyConfig.GetFullDescription(nextQualityBreakConfig.AttrIDList[j], nextQualityBreakConfig.AttrValueList[j], format)); |
| | | } |
| | | |
| | | if (nextQualityBreakConfig.SkillID != 0) |
| | | { |
| | | var skill = SkillConfig.Get(nextQualityBreakConfig.SkillID); |
| | | if (skill != null) |
| | | { |
| | | attrStrArr.Add(Language.Get("L1039", skill.SkillName) + skill.Description); |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError("未配置技能" + nextQualityBreakConfig.SkillID); |
| | | } |
| | | } |
| | | if (i >= potentialCellList.Count) |
| | | { |
| | | potentialCellList.Add(Instantiate(potentialCell, potentialCellParent)); |
| | | } |
| | | var go = potentialCellList[i]; |
| | | var descText = go.GetComponent<Text>(); |
| | | var nameText = go.GetComponent<Text>("skillname"); |
| | | go.SetActive(true); |
| | | if (i < breakLevel) |
| | | { |
| | | nameText.text = Language.Get("herocard63", i + 1); |
| | | descText.text = string.Join("\n", attrStrArr); |
| | | } |
| | | else |
| | | { |
| | | //置灰 |
| | | nameText.text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard63", i + 1)); |
| | | descText.text = UIHelper.AppendColor(TextColType.NavyGray, UIHelper.RemoveColor(string.Join("\n", attrStrArr))); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void DisplayAttr(OtherPlayerDetailManager.RolePlusData.HeroData heroData) |
| | | { |
| | | if (heroData == null || heroData.AttrDict == null) |
| | | { |
| | | return; |
| | | } |
| | | var attrDict = heroData.AttrDict; |
| | | var baseAttrIDList = PlayerPropertyConfig.playerPropertyDict[PlayerPropertyConfig.baseType]; |
| | | var fightAttrIDList = PlayerPropertyConfig.playerPropertyDict[PlayerPropertyConfig.fightType]; |
| | | var totalAttrIDList = baseAttrIDList.Concat(fightAttrIDList).ToList(); |
| | | for (int i = 0; i < attrs.Length; i++) |
| | | { |
| | | if (i < totalAttrIDList.Count) |
| | | { |
| | | attrs[i].SetActive(true); |
| | | int attrId = totalAttrIDList[i]; |
| | | long attrValue = attrDict.ContainsKey(attrId) ? attrDict[attrId] : 0; |
| | | attrs[i].text = PlayerPropertyConfig.GetFullDescription(attrId, attrValue); |
| | | } |
| | | else |
| | | { |
| | | attrs[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private bool HasFetterHero(List<OtherPlayerDetailManager.RolePlusData.HeroData> heroDatas, int heroID) |
| | | { |
| | | if (heroDatas.IsNullOrEmpty()) |
| | | { |
| | | return false; |
| | | } |
| | | for (int i = 0; i < heroDatas.Count; i++) |
| | | { |
| | | if (heroDatas[i].HeroID == heroID) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private void DisplayFetter(List<OtherPlayerDetailManager.RolePlusData.HeroData> heroDatas, int[] FetterIDList) |
| | | { |
| | | if (FetterIDList.IsNullOrEmpty() || heroDatas.IsNullOrEmpty()) |
| | | { |
| | | fetterGo.SetActive(false); |
| | | return; |
| | | } |
| | | |
| | | for (int i = 0; i < fetterText.Length; i++) |
| | | { |
| | | if (i < FetterIDList.Length) |
| | | { |
| | | fetterText[i].SetActive(true); |
| | | var fetterID = FetterIDList[i]; |
| | | HeroFetterConfig fetterConfig = HeroFetterConfig.Get(fetterID); |
| | | List<string> heroNames = new List<string>(); |
| | | bool isAllCollect = true; //是否全收集 |
| | | foreach (var tmpHeroID in fetterConfig.HeroIDList) |
| | | { |
| | | heroNames.Add(HeroConfig.Get(tmpHeroID).Name); |
| | | bool hasFetterHero = HasFetterHero(heroDatas, tmpHeroID); |
| | | if (!hasFetterHero) |
| | | { |
| | | isAllCollect = false; |
| | | } |
| | | } |
| | | fetterGo.SetActive(isAllCollect); |
| | | var attrStr = string.Join(Language.Get("SplitString1"), heroNames) + Language.Get("herocard38"); |
| | | |
| | | for (int j = 0; j < fetterConfig.AttrIDList.Length; j++) |
| | | { |
| | | string format = !isAllCollect ? "{0}+{1}" : "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}"); |
| | | attrStr += Language.Get("L1112") + PlayerPropertyConfig.GetFullDescription(fetterConfig.AttrIDList[j], fetterConfig.AttrValueList[j], format); |
| | | } |
| | | fetterText[i].text = attrStr; |
| | | fetterText[i].color = UIHelper.GetUIColor(isAllCollect ? TextColType.NavyBrown : TextColType.NavyGray); |
| | | fetterNameText[i].text = fetterConfig.FetterName; |
| | | fetterNameText[i].color = UIHelper.GetUIColor(isAllCollect ? TextColType.NavyBrown : TextColType.NavyGray); |
| | | |
| | | } |
| | | else |
| | | { |
| | | fetterText[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void DisplayGiftBaseCell(int heroID, int awakeLevel, List<int> talentIDList, List<int> talentLvList) |
| | | { |
| | | if (talentIDList == null || talentLvList == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | int showCount = HeroUIManager.Instance.GetGiftGirdMaxCount(heroID); |
| | | for (int i = 0; i < giftBaseCells.Length; i++) |
| | | { |
| | | if (i >= showCount) |
| | | { |
| | | giftBaseCells[i].SetActive(false); |
| | | continue; |
| | | } |
| | | |
| | | giftBaseCells[i].SetActive(true); |
| | | if (i < talentIDList.Count) |
| | | { |
| | | int giftID = talentIDList[i]; |
| | | int giftLV = talentLvList[i]; |
| | | int state = 0; //0:不显示 1:新增 2:提升 |
| | | giftBaseCells[i].Init(giftID, giftLV, state, heroID, i, awakeLevel); |
| | | } |
| | | else |
| | | { |
| | | //非对比的显示 |
| | | if (i < HeroUIManager.Instance.normalGiftMaxCnt) |
| | | { |
| | | giftBaseCells[i].Init(0, 0); |
| | | } |
| | | else |
| | | { |
| | | giftBaseCells[i].Init(-1, 0, 0, heroID, i); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | private void DisplayHeroShow(int heroID, int skinID, int breakLevel, int star, int awakeLevel, int lv) |
| | | { |
| | | heroShow.Init(heroID, skinID, breakLevel, star, awakeLevel, lv); |
| | | } |
| | | |
| | | private void DisplaySkill(int heroID, int atkSkillID, int angerSkillID) |
| | | { |
| | | normalSkillCell.Init(atkSkillID, () => |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroSkillWin>(heroID); |
| | | }, true); |
| | | angerSkillCell.Init(angerSkillID, () => |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroSkillWin>(heroID); |
| | | }, true); |
| | | } |
| | | /// <summary> |
| | | /// 强制刷新Layout,解决嵌套Layout和ContentSizeFitter的重叠问题 |
| | | /// </summary> |
| | | async UniTask ForceRefreshLayout() |
| | | { |
| | | await UniTask.DelayFrame(2); |
| | | // 刷新所有Layout组件 |
| | | var layouts = allAttrScroll.GetComponentsInChildren<LayoutGroup>(true); |
| | | foreach (var layout in layouts) |
| | | { |
| | | LayoutRebuilder.ForceRebuildLayoutImmediate(layout.GetComponent<RectTransform>()); |
| | | } |
| | | await UniTask.DelayFrame(2); |
| | | // 刷新所有Layout组件 |
| | | foreach (var layout in layouts) |
| | | { |
| | | LayoutRebuilder.ForceRebuildLayoutImmediate(layout.GetComponent<RectTransform>()); |
| | | } |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f7e36dee1de95fc478795e453dcde29a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | |
| | | public class OtherHeroFightingCardItem : MonoBehaviour |
| | | { |
| | | [SerializeField] Button btnClick; |
| | | [SerializeField] Image imgQuality; |
| | | [SerializeField] Image imgHero; |
| | | [SerializeField] Text txtLv; |
| | | [SerializeField] Image imgCountry; |
| | | [SerializeField] Transform rectStar; |
| | | [SerializeField] List<Image> imgStars; |
| | | OtherPlayerDetailManager.RolePlusData.HeroData heroData; |
| | | List<OtherPlayerDetailManager.RolePlusData.HeroData> heros; |
| | | OtherPlayerDetailManager manager { get { return OtherPlayerDetailManager.Instance; } } |
| | | public void Display(int index, List<OtherPlayerDetailManager.RolePlusData.HeroData> heros) |
| | | { |
| | | this.heros = heros; |
| | | if (heros.IsNullOrEmpty() || index < 0 || index >= heros.Count) |
| | | { |
| | | return; |
| | | } |
| | | heroData = heros[index]; |
| | | var heroID = heroData.HeroID; |
| | | if (!HeroConfig.HasKey(heroID)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var heroConfig = HeroConfig.Get(heroID); |
| | | imgQuality.SetSprite("herocBG" + heroConfig.Quality); |
| | | imgCountry.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country)); |
| | | txtLv.text = heroData.LV == 0 ? "" : Language.Get("L1094") + heroData.LV; |
| | | DisplayHero(heroData); |
| | | DisplayStars(heroData); |
| | | |
| | | btnClick.SetListener(ClickHero); |
| | | } |
| | | |
| | | void DisplayHero(OtherPlayerDetailManager.RolePlusData.HeroData heroData) |
| | | { |
| | | var sprite = UILoader.LoadSprite("HeroHead", HeroSkinConfig.Get(heroData.SkinID).RectangleIcon); |
| | | if (sprite == null) |
| | | { |
| | | // 内网未配置时 |
| | | imgHero.SetSprite("herohead_big_default"); |
| | | } |
| | | else |
| | | { |
| | | imgHero.overrideSprite = sprite; |
| | | } |
| | | } |
| | | |
| | | void DisplayStars(OtherPlayerDetailManager.RolePlusData.HeroData heroData) |
| | | { |
| | | var star = heroData.Star; |
| | | if (star == 0) |
| | | { |
| | | rectStar.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | rectStar.SetActive(true); |
| | | for (int i = 0; i < imgStars.Count; i++) |
| | | { |
| | | if ((star - 1) % imgStars.Count >= i) |
| | | { |
| | | imgStars[i].SetActive(true); |
| | | imgStars[i].SetSprite("herostar" + (((star - 1) / imgStars.Count) + 1) * imgStars.Count); |
| | | } |
| | | else |
| | | { |
| | | imgStars[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | void ClickHero() |
| | | { |
| | | if (heroData == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | manager.heroData = heroData; |
| | | manager.heroDatas = heros; |
| | | |
| | | if (!UIManager.Instance.IsOpened<OtherHeroDetailWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindow<OtherHeroDetailWin>(); |
| | | } |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9d90695eaf6736e418297ded40202c00 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | using System.Linq; |
| | | |
| | | |
| | | //查看其他玩家的简短信息, 该模块处理数据,其他由各自功能模块处理 通过OnRevPackage |
| | | public class OtherPlayerDetailManager : GameSystemManager<OtherPlayerDetailManager> |
| | | { |
| | | |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin; |
| | | } |
| | | |
| | | |
| | | public void OnBeforePlayerDataInitializeEventOnRelogin() |
| | | { |
| | | viewPlayerType = -1; |
| | | viewPlayerLineupType = -1; |
| | | } |
| | | |
| | | public int viewPlayer { get; private set; } |
| | | |
| | | // 查询类型:根据类型做不同处理 |
| | | // 按功能自定义枚举值 EnumHelper的 ViewPlayerType |
| | | public int viewPlayerType { get; private set; } |
| | | |
| | | public int viewPlayerLineupType { get; private set; } |
| | | public RolePlusData.HeroData heroData; |
| | | public List<RolePlusData.HeroData> heroDatas; |
| | | public RolePlusData.EquipData equip; |
| | | private Dictionary<int, ViewPlayerData> viewPlayerDataDic = new Dictionary<int, ViewPlayerData>(); |
| | | |
| | | // 查看类型,玩家ID |
| | | public event Action<int, int> OnRevPackage; //尽量不要用第一个参数viewtype做判断,容易出错 |
| | | |
| | | // 获取其他玩家本地缓存数据 |
| | | public ViewPlayerData GetViewPlayerData(int player) |
| | | { |
| | | ViewPlayerData viewPlayerData = null; |
| | | viewPlayerDataDic.TryGetValue(player, out viewPlayerData); |
| | | return viewPlayerData; |
| | | } |
| | | |
| | | |
| | | // 向服务端请求其他玩家数据 |
| | | public void ViewPlayerDetail(int _playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)TeamType.Story) |
| | | { |
| | | if (_playerId == PlayerDatas.Instance.baseData.PlayerID) |
| | | { |
| | | return; |
| | | } |
| | | viewPlayerType = viewType; |
| | | this.viewPlayerLineupType = viewPlayerLineupType; |
| | | ViewRoleParticulars(_playerId); |
| | | } |
| | | |
| | | // 向服务端请求玩家数据 |
| | | void ViewRoleParticulars(int playerID) |
| | | { |
| | | if (playerID == 0) |
| | | { |
| | | return; |
| | | } |
| | | viewPlayer = playerID; |
| | | if (viewPlayerDataDic.ContainsKey(playerID)) |
| | | { |
| | | ViewPlayerData viewPlayerData = viewPlayerDataDic[playerID]; |
| | | if ((DateTime.Now - viewPlayerData.getTime).TotalSeconds < 30) |
| | | { |
| | | ShowRoleParticulars(playerID); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | //CC002_tagCGViewCrossPlayerInfo c002 = new CC002_tagCGViewCrossPlayerInfo(); |
| | | |
| | | CA212_tagCMViewPlayerInfo pak = new CA212_tagCMViewPlayerInfo(); |
| | | pak.PlayerID = (uint)playerID; |
| | | GameNetSystem.Instance.SendInfo(pak); |
| | | } |
| | | |
| | | |
| | | //本服竞技场假查询模拟封包,返回查看机器人数据 打开RoleParticularsWin界面,专用接口其他地方不要调用 |
| | | public void ViewFairyArenaRobot(int playerID, ViewPlayerData _viewPlayerData) |
| | | { |
| | | ViewPlayerData viewPlayerData = null; |
| | | viewPlayer = playerID; |
| | | if (!viewPlayerDataDic.TryGetValue(playerID, out viewPlayerData)) |
| | | { |
| | | viewPlayerDataDic.Add(playerID, _viewPlayerData); |
| | | } |
| | | else |
| | | { |
| | | viewPlayerDataDic[playerID] = _viewPlayerData; |
| | | } |
| | | |
| | | viewPlayerType = (int)ViewPlayerType.viewPlayerData; |
| | | ShowRoleParticulars(playerID); |
| | | } |
| | | |
| | | |
| | | |
| | | public void OnRevRoleEquip(HA705_tagSCQueryPlayerCacheResult package) |
| | | { |
| | | |
| | | ViewPlayerData viewPlayerData = null; |
| | | if (!viewPlayerDataDic.TryGetValue((int)package.PlayerID, out viewPlayerData)) |
| | | { |
| | | viewPlayerData = new ViewPlayerData(); |
| | | viewPlayerData.getTime = DateTime.Now; |
| | | viewPlayerDataDic.Add((int)package.PlayerID, viewPlayerData); |
| | | } |
| | | |
| | | viewPlayerData.getTime = DateTime.Now; |
| | | viewPlayerData.PlayerID = (int)package.PlayerID; |
| | | viewPlayerData.PlayerName = UIHelper.ServerStringTrim(package.PlayerName); |
| | | viewPlayerData.LV = package.LV; |
| | | viewPlayerData.Job = package.Job; |
| | | viewPlayerData.RealmLV = package.RealmLV; |
| | | viewPlayerData.Face = (int)package.Face; |
| | | viewPlayerData.FacePic = (int)package.FacePic; |
| | | viewPlayerData.ModelMark = (int)package.ModelMark; |
| | | viewPlayerData.EquipShowSwitch = (int)package.EquipShowSwitch; |
| | | viewPlayerData.TitleID = (int)package.TitleID; |
| | | viewPlayerData.ServerID = (int)package.ServerID; |
| | | viewPlayerData.FightPower = package.FightPower + package.FightPowerEx * (long)Constants.ExpPointValue; |
| | | viewPlayerData.FamilyID = (int)package.FamilyID; |
| | | viewPlayerData.FamilyName = UIHelper.ServerStringTrim(package.FamilyName); |
| | | viewPlayerData.FamilyEmblemID = (int)package.FamilyEmblemID; |
| | | viewPlayerData.FamilyEmblemWord = UIHelper.ServerStringTrim(package.FamilyEmblemWord); |
| | | |
| | | |
| | | if (viewPlayerData.rolePlusData == null) |
| | | { |
| | | //第一次初始化 |
| | | viewPlayerData.rolePlusData = new RolePlusData(); |
| | | } |
| | | if (package.PlusDataSize != 0) |
| | | { |
| | | viewPlayerData.rolePlusData.AnalysisRolePlusData(package.PlusData); |
| | | } |
| | | |
| | | |
| | | ShowRoleParticulars((int)package.PlayerID); |
| | | } |
| | | |
| | | //尽量不要用第一个参数viewtype做判断,容易出错,比如同时发送两个不同的viewPlayerType请求的时候 |
| | | private void ShowRoleParticulars(int playerID) |
| | | { |
| | | if (viewPlayerType == (int)ViewPlayerType.viewPlayerData) |
| | | { |
| | | if (!UIManager.Instance.IsOpened<OtherPlayerDetailWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindow<OtherPlayerDetailWin>(viewPlayerLineupType); |
| | | } |
| | | } |
| | | |
| | | OnRevPackage?.Invoke(viewPlayerType, playerID); |
| | | viewPlayerType = -1; |
| | | viewPlayerLineupType = -1; |
| | | } |
| | | #region 获取PlusData中的数据 |
| | | public Dictionary<int, RolePlusData.HeroData> GetHeroDataDict(int playerID, int lineupType) |
| | | { |
| | | ViewPlayerData viewPlayerData = GetViewPlayerData(playerID); |
| | | if (viewPlayerData?.rolePlusData?.LineupDic?.TryGetValue(lineupType, out var lineupData) != true) |
| | | { |
| | | return null; |
| | | } |
| | | return lineupData?.HeroDic; |
| | | } |
| | | |
| | | public List<RolePlusData.HeroData> GetHeroDataSortList(int playerID, int lineupType) |
| | | { |
| | | var heroDataDict = GetHeroDataDict(playerID, lineupType); |
| | | if (heroDataDict == null) |
| | | { |
| | | return null; |
| | | } |
| | | var res = new List<RolePlusData.HeroData>(); |
| | | List<int> keyList = heroDataDict.Keys.ToList(); |
| | | keyList.Sort(); |
| | | foreach (var num in keyList) |
| | | { |
| | | if (!heroDataDict.ContainsKey(num)) |
| | | { |
| | | continue; |
| | | } |
| | | res.Add(heroDataDict[num]); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | public bool TryGetFightPointByTeamType(int playerID, int teamType, out long fightPower) |
| | | { |
| | | fightPower = 0; |
| | | var lineupDic = GetViewPlayerData(playerID)?.rolePlusData?.LineupDic; |
| | | if (lineupDic != null && lineupDic.TryGetValue(teamType, out var lineupData)) |
| | | { |
| | | fightPower = lineupData.FightPower; |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public Dictionary<int, RolePlusData.EquipData> GetEquipDataDict(int playerID) |
| | | { |
| | | ViewPlayerData viewPlayerData = GetViewPlayerData(playerID); |
| | | return viewPlayerData?.rolePlusData?.EquipDic; |
| | | } |
| | | |
| | | public int GetUseDataFirstValue(RolePlusData.EquipData equip, int key) |
| | | { |
| | | if (equip.UserData != null && equip.UserData.ContainsKey(key) && equip.UserData[key].Count > 0) |
| | | { |
| | | return equip.UserData[key][0]; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public int GetUseDataFirstValue(RolePlusData.HeroData hero, int key) |
| | | { |
| | | if (hero.Data != null && hero.Data.ContainsKey(key) && hero.Data[key].Count > 0) |
| | | { |
| | | return hero.Data[key][0]; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public int GetEquipLV(RolePlusData.EquipData equip) |
| | | { |
| | | if (equip == null) |
| | | { |
| | | return 0; |
| | | } |
| | | return GetUseDataFirstValue(equip, 22); |
| | | } |
| | | |
| | | public List<int> GetUseData(RolePlusData.EquipData equip, int key) |
| | | { |
| | | List<int> list = null; |
| | | if (equip.UserData != null) |
| | | { |
| | | equip.UserData.TryGetValue(key, out list); |
| | | } |
| | | return list == null ? new List<int>() : list; |
| | | } |
| | | |
| | | public List<int> GetUseData(RolePlusData.HeroData hero, int key) |
| | | { |
| | | List<int> list = null; |
| | | if (hero.Data != null) |
| | | { |
| | | hero.Data.TryGetValue(key, out list); |
| | | } |
| | | return list == null ? new List<int>() : list; |
| | | } |
| | | |
| | | //基础属性ID列表 |
| | | public List<int> GetEquipBaseAttrs(RolePlusData.EquipData equip) |
| | | { |
| | | if (equip == null) |
| | | { |
| | | return new List<int>(); |
| | | } |
| | | return GetUseData(equip, 21); |
| | | } |
| | | |
| | | |
| | | //基础属性值列表 |
| | | public List<int> GetEquipBaseValues(RolePlusData.EquipData equip) |
| | | { |
| | | if (equip == null) |
| | | { |
| | | return new List<int>(); |
| | | } |
| | | return GetUseData(equip, 23); |
| | | } |
| | | |
| | | //战斗属性ID列表 |
| | | public List<int> GetEquipFightAttrs(RolePlusData.EquipData equip) |
| | | { |
| | | if (equip == null) |
| | | { |
| | | return new List<int>(); |
| | | } |
| | | return GetUseData(equip, 17); |
| | | } |
| | | |
| | | //战斗属性值列表 |
| | | public List<int> GetEquipFightValues(RolePlusData.EquipData equip) |
| | | { |
| | | if (equip == null) |
| | | { |
| | | return new List<int>(); |
| | | } |
| | | return GetUseData(equip, 19); |
| | | } |
| | | |
| | | // 武将突破等级 |
| | | public int GetBreakLevel(RolePlusData.HeroData hero) |
| | | { |
| | | if (hero == null) |
| | | return 0; |
| | | return GetUseDataFirstValue(hero, 74); |
| | | } |
| | | |
| | | // 武将觉醒等级 |
| | | public int GetAwakeLevel(RolePlusData.HeroData hero) |
| | | { |
| | | |
| | | if (hero == null) |
| | | return 0; |
| | | return GetUseDataFirstValue(hero, 76); |
| | | } |
| | | // 71 # 英雄天赋ID列表 |
| | | public List<int> GetTalentIDList(RolePlusData.HeroData hero) |
| | | { |
| | | if (hero == null) |
| | | return new List<int>(); |
| | | return GetUseData(hero, 71); |
| | | } |
| | | |
| | | // 73 # 英雄天赋ID等级列表,对应71天赋ID的等级 |
| | | public List<int> GetTalentLvList(RolePlusData.HeroData hero) |
| | | { |
| | | if (hero == null) |
| | | return new List<int>(); |
| | | return GetUseData(hero, 73); |
| | | } |
| | | |
| | | // 获取红颜属性值 |
| | | public RolePlusData.BeautyData GetBeautyData(int playerID) |
| | | { |
| | | ViewPlayerData viewPlayerData = GetViewPlayerData(playerID); |
| | | return viewPlayerData?.rolePlusData?.beautyData; |
| | | } |
| | | |
| | | // 获取坐骑数据对象 |
| | | public RolePlusData.HorseData GetHorseData(int playerID) |
| | | { |
| | | ViewPlayerData viewPlayerData = GetViewPlayerData(playerID); |
| | | return viewPlayerData?.rolePlusData?.horseData; |
| | | } |
| | | |
| | | #endregion |
| | | #region 解析PlusData |
| | | public class ViewPlayerData |
| | | { |
| | | public int PlayerID; |
| | | public string PlayerName; |
| | | public int LV; |
| | | public int Job; |
| | | public int RealmLV; |
| | | public int Face; |
| | | public int FacePic; |
| | | public int ModelMark; // 变形模型mark |
| | | public int EquipShowSwitch; // 其他外观信息 |
| | | public int TitleID; |
| | | public int ServerID; |
| | | public long FightPower; |
| | | public int FamilyID; |
| | | public string FamilyName; |
| | | public int FamilyEmblemID; |
| | | public string FamilyEmblemWord; |
| | | public RolePlusData rolePlusData; |
| | | public DateTime getTime; |
| | | } |
| | | |
| | | public class RolePlusData |
| | | { |
| | | // --- 定义存储数据的结构 --- |
| | | |
| | | // 装备字典 <位置索引, 装备数据> |
| | | public Dictionary<int, EquipData> EquipDic = new Dictionary<int, EquipData>(); |
| | | |
| | | // 阵容字典 <阵容ID, 阵容数据> |
| | | public Dictionary<int, LineupData> LineupDic = new Dictionary<int, LineupData>(); |
| | | |
| | | // 红颜数据 |
| | | public BeautyData beautyData; |
| | | |
| | | // 坐骑数据 |
| | | public HorseData horseData; |
| | | |
| | | // 红颜数据类 |
| | | public class BeautyData |
| | | { |
| | | public int Cnt; // 已解锁数 |
| | | public Dictionary<int, long> AttrDict = new Dictionary<int, long>(); // 属性 |
| | | } |
| | | |
| | | // 坐骑数据类 |
| | | public class HorseData |
| | | { |
| | | public int LV; // 等级 |
| | | public int ClassLV; // 阶级 |
| | | public Dictionary<int, long> AttrDict = new Dictionary<int, long>(); // 属性 |
| | | } |
| | | |
| | | // 装备数据类 |
| | | public class EquipData |
| | | { |
| | | public int ItemID; |
| | | public Dictionary<int, List<int>> UserData = new Dictionary<int, List<int>>(); |
| | | } |
| | | |
| | | // 阵容数据类 |
| | | public class LineupData |
| | | { |
| | | public int PlayerID; |
| | | public long FightPower; |
| | | public int ShapeType; |
| | | // 英雄字典 <站位, 英雄数据> |
| | | public Dictionary<int, HeroData> HeroDic = new Dictionary<int, HeroData>(); |
| | | |
| | | } |
| | | |
| | | // 英雄数据类 |
| | | public class HeroData |
| | | { |
| | | public int HeroID; |
| | | public int SkinID; |
| | | public int LV; |
| | | public int Star; |
| | | public long FightPower; |
| | | public List<int> SkillIDList = new List<int>(); |
| | | // 属性字典 <属性ID, 属性值> |
| | | public Dictionary<int, long> AttrDict = new Dictionary<int, long>(); |
| | | // 英雄专属UserData (格式与物品UserData相同) |
| | | // 使用 Dictionary<int, List<int>> 结构,key为ItemUseDataKey枚举值 |
| | | public Dictionary<int, List<int>> Data = new Dictionary<int, List<int>>(); |
| | | } |
| | | |
| | | // 通用的属性解析方法 |
| | | private Dictionary<int, long> ParseAttrDict(JsonData jd, string key) |
| | | { |
| | | Dictionary<int, long> result = new Dictionary<int, long>(); |
| | | if (jd.Keys.Contains(key)) |
| | | { |
| | | JsonData attrs = jd[key]; |
| | | foreach (string attrKey in attrs.Keys) |
| | | { |
| | | if (int.TryParse(attrKey, out int attrId)) |
| | | { |
| | | JsonData v = attrs[attrKey]; |
| | | long val = 0; |
| | | // 健壮性数值转换 |
| | | if (v.IsLong) val = (long)v; |
| | | else if (v.IsInt) val = (long)(int)v; |
| | | else if (v.IsDouble) val = (long)(double)v; |
| | | else if (v.IsString) long.TryParse(v.ToString(), out val); |
| | | |
| | | result[attrId] = val; |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | // --- 解析逻辑 --- |
| | | public void AnalysisRolePlusData(string jsonStr) |
| | | { |
| | | try |
| | | { |
| | | if (string.IsNullOrEmpty(jsonStr)) return; |
| | | |
| | | EquipDic.Clear(); |
| | | LineupDic.Clear(); |
| | | beautyData = null; // 必须置空,防止显示上一个玩家的数据 |
| | | horseData = null; // 必须置空 |
| | | // 1. 转为 JsonData 对象 |
| | | JsonData jd = JsonMapper.ToObject(jsonStr); |
| | | |
| | | // 2. 解析装备 (Equip) |
| | | if (jd.Keys.Contains("Equip")) |
| | | { |
| | | JsonData equipJd = jd["Equip"]; |
| | | foreach (string key in equipJd.Keys) |
| | | { |
| | | if (int.TryParse(key, out int posIndex)) |
| | | { |
| | | JsonData itemJd = equipJd[key]; |
| | | EquipData equipData = new EquipData(); |
| | | |
| | | if (itemJd.Keys.Contains("ItemID")) |
| | | equipData.ItemID = (int)itemJd["ItemID"]; |
| | | |
| | | if (itemJd.Keys.Contains("UserData") && !string.IsNullOrEmpty((string)itemJd["UserData"])) |
| | | equipData.UserData = ConfigParse.Analysis((string)itemJd["UserData"]); |
| | | |
| | | EquipDic[posIndex] = equipData; |
| | | } |
| | | } |
| | | } |
| | | // 【新增】解析红颜 (Beauty) |
| | | if (jd.Keys.Contains("Beauty")) |
| | | { |
| | | JsonData beautyJd = jd["Beauty"]; |
| | | beautyData = new BeautyData(); |
| | | |
| | | if (beautyJd.Keys.Contains("Cnt")) |
| | | beautyData.Cnt = (int)beautyJd["Cnt"]; |
| | | |
| | | // 解析属性 |
| | | beautyData.AttrDict = ParseAttrDict(beautyJd, "Attr"); |
| | | } |
| | | // 【新增】解析坐骑 (Horse) |
| | | if (jd.Keys.Contains("Horse")) |
| | | { |
| | | JsonData horseJd = jd["Horse"]; |
| | | horseData = new HorseData(); |
| | | |
| | | if (horseJd.Keys.Contains("LV")) |
| | | horseData.LV = (int)horseJd["LV"]; |
| | | |
| | | if (horseJd.Keys.Contains("ClassLV")) |
| | | horseData.ClassLV = (int)horseJd["ClassLV"]; |
| | | |
| | | // 解析属性 |
| | | horseData.AttrDict = ParseAttrDict(horseJd, "Attr"); |
| | | } |
| | | // 3. 解析阵容 (Lineup) |
| | | if (jd.Keys.Contains("Lineup")) |
| | | { |
| | | JsonData lineupJd = jd["Lineup"]; |
| | | foreach (string key in lineupJd.Keys) |
| | | { |
| | | if (int.TryParse(key, out int lineupId)) |
| | | { |
| | | JsonData oneLineupJd = lineupJd[key]; |
| | | LineupData lineupData = new LineupData(); |
| | | |
| | | if (oneLineupJd.Keys.Contains("PlayerID")) |
| | | lineupData.PlayerID = (int)oneLineupJd["PlayerID"]; |
| | | |
| | | if (oneLineupJd.Keys.Contains("FightPower")) |
| | | lineupData.FightPower = long.Parse(oneLineupJd["FightPower"].ToString()); |
| | | |
| | | if (oneLineupJd.Keys.Contains("ShapeType")) |
| | | lineupData.ShapeType = (int)oneLineupJd["ShapeType"]; |
| | | |
| | | // 解析阵容下的英雄 (Hero) |
| | | if (oneLineupJd.Keys.Contains("Hero")) |
| | | { |
| | | JsonData heroRootJd = oneLineupJd["Hero"]; |
| | | foreach (string heroKey in heroRootJd.Keys) |
| | | { |
| | | if (int.TryParse(heroKey, out int heroPos)) |
| | | { |
| | | JsonData heroJd = heroRootJd[heroKey]; |
| | | HeroData heroData = new HeroData(); |
| | | |
| | | if (heroJd.Keys.Contains("HeroID")) heroData.HeroID = (int)heroJd["HeroID"]; |
| | | if (heroJd.Keys.Contains("SkinID")) heroData.SkinID = (int)heroJd["SkinID"]; |
| | | if (heroJd.Keys.Contains("LV")) heroData.LV = (int)heroJd["LV"]; |
| | | if (heroJd.Keys.Contains("Star")) heroData.Star = (int)heroJd["Star"]; |
| | | if (heroJd.Keys.Contains("FightPower")) heroData.FightPower = long.Parse(heroJd["FightPower"].ToString()); |
| | | // 解析Data字段(武将物品UserData) |
| | | if (heroJd.Keys.Contains("Data") && !string.IsNullOrEmpty((string)heroJd["Data"])) |
| | | { |
| | | heroData.Data = ConfigParse.Analysis((string)heroJd["Data"]); |
| | | } |
| | | |
| | | // 解析技能列表 List<int> |
| | | if (heroJd.Keys.Contains("SkillIDList")) |
| | | { |
| | | JsonData skills = heroJd["SkillIDList"]; |
| | | for (int i = 0; i < skills.Count; i++) |
| | | { |
| | | heroData.SkillIDList.Add((int)skills[i]); |
| | | } |
| | | } |
| | | heroData.AttrDict = ParseAttrDict(heroJd, "AttrDict"); |
| | | lineupData.HeroDic[heroPos] = heroData; |
| | | } |
| | | } |
| | | } |
| | | LineupDic[lineupId] = lineupData; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Debug.LogError("AnalysisRolePlusData Error: " + e.Message + "\nJSON: " + jsonStr); |
| | | } |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class OtherPlayerDetailWin : UIBase |
| | | { |
| | | [SerializeField] AvatarCell avatarCell; |
| | | [SerializeField] OfficialTitleCell officialTitle; |
| | | [SerializeField] HorseController horseModel; |
| | | [SerializeField] TextEx txtPlayerName; |
| | | [SerializeField] TextEx txtPlayerId; |
| | | [SerializeField] TextEx txtServerName; |
| | | [SerializeField] TextEx txtLV; |
| | | [SerializeField] TextEx txtFightPower; |
| | | [SerializeField] ButtonEx btnCopy; |
| | | [SerializeField] ButtonEx btnGuild; |
| | | [SerializeField] GuildEmblemCell guildEmblem; |
| | | [SerializeField] TextEx txtGuildName; |
| | | [SerializeField] OtherHeroFightingCardItem[] heroFightingCards; |
| | | [SerializeField] OtherEquipCardItem[] equipCards; |
| | | [SerializeField] ButtonEx btnMM; |
| | | [SerializeField] TextEx txtMMCnt; |
| | | [SerializeField] ButtonEx btnHorse; |
| | | [SerializeField] HorseController horseController; |
| | | [SerializeField] TextEx txtHorseLV; |
| | | [SerializeField] ImageEx imgHorseBG; |
| | | [SerializeField] ButtonEx btnBlock; |
| | | [SerializeField] ButtonEx btnReport; |
| | | [SerializeField] ButtonEx btnAddFriend; |
| | | [SerializeField] ButtonEx btnPrivateChat; |
| | | OtherPlayerDetailManager.ViewPlayerData viewPlayerData; |
| | | OtherPlayerDetailManager manager { get { return OtherPlayerDetailManager.Instance; } } |
| | | |
| | | int teamType = -1; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | btnReport.SetListener(OnClickReport); |
| | | btnCopy.SetListener(OnClickCopy); |
| | | btnGuild.SetListener(OnClickGuild); |
| | | btnMM.SetListener(OnClickMM); |
| | | btnHorse.SetListener(OnClickHorse); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | GuildManager.Instance.OnRefreshFairyList += OnRefreshFairyList; |
| | | teamType = functionOrder; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | GuildManager.Instance.OnRefreshFairyList -= OnRefreshFairyList; |
| | | } |
| | | |
| | | private void OnRefreshFairyList() |
| | | { |
| | | if (viewPlayerData == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (!GuildManager.Instance.guildsDict.ContainsKey(viewPlayerData.FamilyID)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (!UIManager.Instance.IsOpened<GuildPreviewWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindow<GuildPreviewWin>(viewPlayerData.FamilyID); |
| | | } |
| | | } |
| | | |
| | | private void Display() |
| | | { |
| | | viewPlayerData = manager.GetViewPlayerData(manager.viewPlayer); |
| | | if (viewPlayerData == null) |
| | | { |
| | | Debug.LogError($"OtherPlayerDetailWin Display 未找到玩家ID{manager.viewPlayer}的数据"); |
| | | CloseWindow(); |
| | | return; |
| | | } |
| | | |
| | | |
| | | DisplayPlayerInfo(viewPlayerData); |
| | | DisplayGuildInfo(viewPlayerData); |
| | | |
| | | int playerID = viewPlayerData.PlayerID; |
| | | |
| | | DisplayMM(playerID); |
| | | |
| | | var heroList = manager.GetHeroDataSortList(playerID, teamType); |
| | | if (heroList.IsNullOrEmpty()) |
| | | { |
| | | heroList = manager.GetHeroDataSortList(playerID, (int)TeamType.Story); |
| | | } |
| | | DisplayCard(heroList); |
| | | |
| | | long fightPonit; |
| | | if (!manager.TryGetFightPointByTeamType(playerID, teamType, out fightPonit)) |
| | | { |
| | | if (!manager.TryGetFightPointByTeamType(playerID, (int)TeamType.Story, out fightPonit)) |
| | | { |
| | | fightPonit = 0; |
| | | } |
| | | } |
| | | txtFightPower.text = UIHelper.ReplaceLargeArtNum(fightPonit); |
| | | |
| | | |
| | | var equipDict = manager.GetEquipDataDict(playerID); |
| | | DisplayEquip(equipDict); |
| | | } |
| | | |
| | | private void DisplayMM(int playerID) |
| | | { |
| | | OtherPlayerDetailManager.RolePlusData.BeautyData beautyData = manager.GetBeautyData(playerID); |
| | | txtMMCnt.text = Language.Get("OtherPlayerDetail08", beautyData == null ? 0 : beautyData.Cnt); |
| | | } |
| | | private void DisplayGuildInfo(OtherPlayerDetailManager.ViewPlayerData viewPlayerData) |
| | | { |
| | | if (viewPlayerData.FamilyEmblemID <= 0 || string.IsNullOrEmpty(viewPlayerData.FamilyEmblemWord)) |
| | | { |
| | | btnGuild.SetActive(false); |
| | | return; |
| | | } |
| | | btnGuild.SetActive(true); |
| | | guildEmblem.Display(viewPlayerData.FamilyEmblemID, viewPlayerData.FamilyEmblemWord, 0.35f); |
| | | txtGuildName.text = viewPlayerData.FamilyName; |
| | | |
| | | } |
| | | |
| | | private void DisplayPlayerInfo(OtherPlayerDetailManager.ViewPlayerData viewPlayerData) |
| | | { |
| | | txtPlayerName.text = viewPlayerData.PlayerName; |
| | | txtPlayerId.text = Language.Get("OtherPlayerDetail02", viewPlayerData.PlayerID); |
| | | txtServerName.text = Language.Get("PlayerProfile11", ServerListCenter.Instance.GetServerName(viewPlayerData.ServerID)); |
| | | txtLV.text = viewPlayerData.LV.ToString(); |
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel(viewPlayerData.PlayerID, viewPlayerData.Face, viewPlayerData.FacePic)); |
| | | officialTitle.InitUI(viewPlayerData.RealmLV, viewPlayerData.TitleID); |
| | | DisplayHorseModel(viewPlayerData); |
| | | |
| | | } |
| | | |
| | | private void DisplayHorseModel(OtherPlayerDetailManager.ViewPlayerData viewPlayerData) |
| | | { |
| | | int horseSkinID = HorseManager.Instance.GetOtherPlayerHorseSkinID(viewPlayerData.EquipShowSwitch); |
| | | int modelMark = viewPlayerData.ModelMark; |
| | | |
| | | // 如果 ModelMark 为 0,获取默认的 ModelMark |
| | | if (modelMark == 0) |
| | | { |
| | | PhantasmPavilionManager.Instance.TryGetDefaultID(PhantasmPavilionType.Model, viewPlayerData.Job, out modelMark); |
| | | } |
| | | |
| | | if (!ModelConfig.HasKey(modelMark)) |
| | | { |
| | | horseModel.SetActive(false); |
| | | return; |
| | | } |
| | | |
| | | horseModel.SetActive(true); |
| | | |
| | | var modelConfig = ModelConfig.Get(modelMark); |
| | | int heroSkinID = modelConfig.SkinID; |
| | | horseModel.Create(horseSkinID, heroSkinID, 1); |
| | | |
| | | OtherPlayerDetailManager.RolePlusData.HorseData horseData = manager.GetHorseData(viewPlayerData.PlayerID); |
| | | imgHorseBG.SetActive(horseData != null); |
| | | if (horseData != null) |
| | | { |
| | | txtHorseLV.text = Language.Get("Horse8", horseData == null ? 0 : horseData.ClassLV, horseData == null ? 0 : horseData.LV); |
| | | horseController.Create(horseSkinID, 0, 0.6f); |
| | | } |
| | | } |
| | | |
| | | private void DisplayCard(List<OtherPlayerDetailManager.RolePlusData.HeroData> heros) |
| | | { |
| | | if (heros.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | //显示卡牌 |
| | | for (int i = 0; i < heroFightingCards.Length; i++) |
| | | { |
| | | if (i < heros.Count) |
| | | { |
| | | heroFightingCards[i].Display(i, heros); |
| | | heroFightingCards[i].SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | heroFightingCards[i].SetActive(false); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | private void DisplayEquip(Dictionary<int, OtherPlayerDetailManager.RolePlusData.EquipData> equips) |
| | | { |
| | | if (equips.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | for (int i = 0; i < equipCards.Length; i++) |
| | | { |
| | | equipCards[i].Display(equips.TryGetValue(i, out var equipData) ? equipData : null); |
| | | } |
| | | } |
| | | |
| | | |
| | | private void OnClickReport() |
| | | { |
| | | ConfirmCancel.ShowPopConfirm( |
| | | Language.Get("L1003"), |
| | | Language.Get("OtherPlayerDetail06", "山寨名字"), |
| | | (bool isOK) => |
| | | { |
| | | if (isOK) |
| | | { |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private void OnClickCopy() |
| | | { |
| | | if (viewPlayerData == null) |
| | | { |
| | | return; |
| | | } |
| | | UIHelper.CopyToClipboard(viewPlayerData.PlayerID.ToString()); |
| | | SysNotifyMgr.Instance.ShowTip("CopySuccess"); |
| | | } |
| | | |
| | | private void OnClickGuild() |
| | | { |
| | | if (viewPlayerData == null) |
| | | { |
| | | return; |
| | | } |
| | | //自己的公会 |
| | | if (PlayerDatas.Instance.fairyData.HasFairy && PlayerDatas.Instance.fairyData.fairy.FamilyID == viewPlayerData.FamilyID) |
| | | { |
| | | return; |
| | | } |
| | | GuildManager.Instance.SendFindGuildNoDecrypt(viewPlayerData.FamilyID.ToString()); |
| | | } |
| | | |
| | | private void OnClickMM() |
| | | { |
| | | if (viewPlayerData == null) |
| | | { |
| | | return; |
| | | } |
| | | int playerID = viewPlayerData.PlayerID; |
| | | OtherPlayerDetailManager.RolePlusData.BeautyData beautyData = manager.GetBeautyData(playerID); |
| | | |
| | | AttributeManager.Instance.OpenTotalAttributeWin(beautyData == null || beautyData.AttrDict == null ? new Dictionary<int, long>() : beautyData.AttrDict); |
| | | } |
| | | private void OnClickHorse() |
| | | { |
| | | if (viewPlayerData == null) |
| | | { |
| | | return; |
| | | } |
| | | int playerID = viewPlayerData.PlayerID; |
| | | OtherPlayerDetailManager.RolePlusData.HorseData horseData = manager.GetHorseData(playerID); |
| | | if (horseData == null) |
| | | { |
| | | return; |
| | | } |
| | | AttributeManager.Instance.OpenTotalAttributeWin(horseData.AttrDict == null ? new Dictionary<int, long>() : horseData.AttrDict); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 684d231e50deab144b92606e0f6373fa |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System;
|
| | | using UnityEngine;
|
| | | using UnityEngine.Events;
|
| | |
|
| | | //头像模块
|
| | | public class AvatarCell : MonoBehaviour
|
| | |
| | | return m_redpoint;
|
| | | }
|
| | | }
|
| | |
|
| | | GameObject prefab;
|
| | | AvatarModel avatarModel;
|
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } }
|
| | |
| | | faceBGImage.SetNativeSize();
|
| | | faceImage.SetNativeSize();
|
| | | facePicImage.SetNativeSize();
|
| | | BindButtonClick(model);
|
| | | }
|
| | | // 添加标志位:是否已设置自定义监听器
|
| | | private bool hasCustomListener = false;
|
| | | public void SetListener(UnityAction action)
|
| | | {
|
| | | hasCustomListener = true; // 标记已设置自定义监听
|
| | | button.SetListener(action);
|
| | | }
|
| | | public void AddListener(UnityAction action)
|
| | | {
|
| | | hasCustomListener = true; // 标记已设置自定义监听
|
| | | button.SetListener(action);
|
| | | }
|
| | | private void BindButtonClick(AvatarModel model)
|
| | | {
|
| | | // 如果已经设置了自定义监听器,不覆盖
|
| | | if (hasCustomListener)
|
| | | return;
|
| | |
|
| | | button.SetListener(() =>
|
| | | {
|
| | | if (avatarModel == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | AvatarHelper.TryViewOtherPlayerInfo(avatarModel.playerID, (int)ViewPlayerType.viewPlayerData, (int)TeamType.Story);
|
| | | });
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public class AvatarModel
|
| | |
| | | public int playerID { get; private set; }
|
| | | public int faceID { get; private set; }
|
| | | public int facePicID { get; private set; }
|
| | | public int redpointID { get; private set; }
|
| | | public Action clickAction { get; private set; }
|
| | |
|
| | | public AvatarModel(int playerID, int faceID, int facePicID, int redpointID = 0, Action clickAction = null)
|
| | | public AvatarModel(int playerID, int faceID, int facePicID)
|
| | | {
|
| | | this.playerID = playerID;
|
| | | this.faceID = faceID;
|
| | | this.facePicID = facePicID;
|
| | | this.redpointID = redpointID;
|
| | | this.clickAction = clickAction;
|
| | | }
|
| | | } |
| | |
| | | using System;
|
| | |
|
| | | public static class AvatarHelper
|
| | | {
|
| | | public static void TryViewOtherPlayerInfo(int _playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)TeamType.Story)
|
| | | {
|
| | | if (_playerId == PlayerDatas.Instance.PlayerId || UIManager.Instance.IsOpened<OtherPlayerDetailWin>())
|
| | | return;
|
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(_playerId, viewType, viewPlayerLineupType);
|
| | | }
|
| | |
|
| | | public static AvatarModel GetAvatarModel(int playerId, int face, int facePic, int job = 0)
|
| | | {
|
| | | bool isMyself = playerId == PlayerDatas.Instance.PlayerId;
|
| | |
| | | btnSetting.SetListener(() => { UIManager.Instance.OpenWindow<SystemSetWin>(); }); |
| | | btnAnnouncement.SetListener(() => { GameNotice.OpenGameNoticeForce(); }); |
| | | btnSwitchServer.SetListener(() => { GameNetSystem.Instance.LoginOut(); }); |
| | | btnRedemptionCode.SetListener(() => { UIManager.Instance.OpenWindow<ExchangeCodeWin>(); }); |
| | | btnRedemptionCode.SetListener(() => |
| | | { |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Mail, true)) |
| | | return; |
| | | UIManager.Instance.OpenWindow<ExchangeCodeWin>(); |
| | | }); |
| | | btnCopy.SetListener(() => |
| | | { |
| | | UIHelper.CopyToClipboard(PlayerDatas.Instance.baseData.PlayerID.ToString()); |
| | |
| | | btnChangeName.SetListener(() => { UIManager.Instance.OpenWindow<RenameWin>(); }); |
| | | btnText1.SetListener(() => |
| | | { |
| | | GameAgeWarnWin.data = 1; |
| | | UIManager.Instance.OpenWindow<GameAgeWarnWin>(); |
| | | // GameAgeWarnWin.data = 1; |
| | | // UIManager.Instance.OpenWindow<GameAgeWarnWin>(); |
| | | SDKUtils.Instance.OpenUrl(OPConfigConfig.Get("yhxy").content); |
| | | }); |
| | | btnText2.SetListener(() => |
| | | { |
| | | GameAgeWarnWin.data = 2; |
| | | UIManager.Instance.OpenWindow<GameAgeWarnWin>(); |
| | | // GameAgeWarnWin.data = 2; |
| | | // UIManager.Instance.OpenWindow<GameAgeWarnWin>(); |
| | | SDKUtils.Instance.OpenUrl(OPConfigConfig.Get("yszc").content); |
| | | }); |
| | | avatarCell.redpoint.redpointId = MainRedDot.PhantasmPavilionRepoint; |
| | | avatarCell.button.SetListener(() => |
| | | avatarCell.SetListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<PhantasmPavilionWin>(); |
| | | }); |
| | |
| | | protected override void OnPreClose() |
| | | { |
| | | InvestModel.Instance.onInvestUpdate -= OnInvestUpdate; |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | |
| | | } |
| | | |
| | |
| | | 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);
|
| | |
| | | { |
| | | public QuickSetting() |
| | | { |
| | | quickSettingDic.Clear(); |
| | | //自动战斗 几倍消耗 几倍速度 是否高战力停止 是否开启自动战斗 |
| | | quickSettingDic.Add(QuickSettingType.AutoFight_Cost, new QuickSettingRange(QuickSettingType.AutoFight_Cost, 0, 1)); |
| | | quickSettingDic.Add(QuickSettingType.AutoFight_Speed, new QuickSettingRange(QuickSettingType.AutoFight_Speed, 1, 1)); |
| | |
| | | quickSettingDic.Add(QuickSettingType.CreateRole, new QuickSettingRange(QuickSettingType.CreateRole, 17, 1)); |
| | | |
| | | setting = new string(UCharacter, 100); |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerDataInitializeEvent; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | } |
| | | |
| | |
| | | [SerializeField] Button freeButton; |
| | | [SerializeField] Image freeRedPoint; |
| | | [SerializeField] Text freeText; |
| | | |
| | | [SerializeField] Image exclusiveImage;//专属 |
| | | public void Display(int index) |
| | | { |
| | | if (!StoreModel.Instance.storeTypeDict.ContainsKey((int)StoreModel.Instance.selectStoreFuncType)) |
| | |
| | | int shopID = storeData.shopId; |
| | | var itemID = storeData.storeConfig.ItemID; |
| | | var itemCount = storeData.storeConfig.ItemCnt; |
| | | |
| | | exclusiveImage.SetActive(storeData.storeConfig.IsExclusive == 1); |
| | | itemCell.Init(new ItemCellModel(itemID, false, itemCount)); |
| | | itemCell.button.AddListener(() => |
| | | { |
| | |
| | | |
| | | public SystemSetting() |
| | | { |
| | | DTC0102_tagCDBPlayer.switchAccountEvent -= OnSwitchAccount; |
| | | DTC0102_tagCDBPlayer.switchAccountEvent += OnSwitchAccount; |
| | | } |
| | | |
| | |
| | | // 最大血量 |
| | | public long maxHp; |
| | | |
| | | |
| | | // 战力 |
| | | public long fightPower; |
| | | } |
| | |
| | | |
| | | curHp = (long)fightObj.HPEx * (long)Constants.ExpPointValue + (long)fightObj.HP; |
| | | maxHp = (long)fightObj.MaxHPEx * (long)Constants.ExpPointValue + (long)fightObj.MaxHP; |
| | | fightPower = (long)fightObj.FightPowerEx * (long)Constants.ExpPointValue + (long)fightObj.FightPower; |
| | | rage = (int)fightObj.AngreXP; |
| | | |
| | | positionNum = fightObj.PosNum - 1; |
| | |
| | | public void Display(int rankType, int rank, string valueFormat) |
| | | { |
| | | RankData rankData = null; |
| | | int viewPlayerId = (int)PlayerDatas.Instance.baseData.PlayerID; |
| | | if (rank != 0) |
| | | { |
| | | rankData = RankModel.Instance.GetRankDataByRank(rankType, rank); |
| | |
| | | officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2); |
| | | avatarCell.SetActive(true); |
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)rankData.id, (int)rankData.value3, (int)rankData.value4)); |
| | | viewPlayerId = (int)rankData.id; |
| | | nameText.text = rankData.name1; |
| | | rankValueText.text = string.Format(valueFormat, UIHelper.ReplaceLargeNum(rankData.cmpValue2 + rankData.cmpValue * Constants.ExpPointValue)); |
| | | } |
| | |
| | | { |
| | | queryPlayerBtn.AddListener(() => |
| | | { |
| | | |
| | | AvatarHelper.TryViewOtherPlayerInfo(viewPlayerId); |
| | | }); |
| | | } |
| | | } |
| | |
| | | officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2); |
| | | model.SetActive(true); |
| | | model.Create(HorseManager.Instance.GetOtherPlayerHorseSkinID((int)rankData.value6), (int)rankData.value5, rank == 1 ? 1f : 0.8f); |
| | | queryPlayerBtn.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id); |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | var sprite = UILoader.LoadSprite("icon", itemConfig.IconKey); |
| | | _image.overrideSprite = sprite; |
| | | _image.SetOrgSprite(itemConfig.IconKey, |
| | | GeneralDefine.itemIconDict.ContainsKey(itemConfig.Type) ? GeneralDefine.itemIconDict[itemConfig.Type] : "icon"); |
| | | |
| | | } |
| | | |
| | | public static void SetSkillSprite(this Image _image, int skillID) |
| | |
| | | AutoFight = 20,//自动战斗 |
| | | Recharge = 22,//充值 |
| | | PrivilegeCard = 25, //特权卡 |
| | | GuaBao = 28, //古宝 |
| | | Horse = 37, //坐骑 |
| | | HeroAwake = 38, //武将觉醒 |
| | | BattlePass = 40, //基金(战令) |
| | |
| | | viewPlayerData = 0, //查看玩家基本信息,公用打开界面 |
| | | viewGuildLeader = 1, //查看玩家的公会族长信息 |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | //功能品质文字颜色,哪些功能由美术决定,目前用于古宝 |
| | | 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) |