Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
21个文件已修改
4个文件已删除
19 文件已复制
23个文件已添加
2 文件已重命名
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public string GetErrorTip(int key) |
| | | { |
| | | if (!FuncOpenLVConfig.HasKey(key)) |
| | | return string.Empty; |
| | | FuncOpenLVConfig config = FuncOpenLVConfig.Get(key); |
| | | if (!IsFuncOpen(key, out int errorCode)) |
| | | { |
| | | switch (errorCode) |
| | | { |
| | | case 1: |
| | | return StringUtility.Contact( |
| | | Language.Get("FuncLimit_Level", config.LimitLV), |
| | | Language.Get("FuncLimitOpen1")); |
| | | case 2: |
| | | //开服多少天 一般是组合 |
| | | if (config.LimitLV != 0) |
| | | { |
| | | return StringUtility.Contact( |
| | | Language.Get("FuncLimit_OpenDay", config.OpenDay), |
| | | Language.Get("FuncLimitOpen2"), |
| | | Language.Get("FuncLimit_Level", config.LimitLV), |
| | | Language.Get("FuncLimitOpen1")); |
| | | |
| | | } |
| | | else if (config.LimitMissionID != 0) |
| | | { |
| | | return StringUtility.Contact( |
| | | Language.Get("FuncLimit_OpenDay", config.OpenDay), |
| | | Language.Get("FuncLimitOpen2"), |
| | | Language.Get("FuncLimit_Mission", |
| | | TaskManager.Instance.GetNeedFinishTaskCount(config.LimitMissionID)), |
| | | Language.Get("FuncLimitOpen1")); |
| | | } |
| | | else |
| | | { |
| | | return StringUtility.Contact( |
| | | Language.Get("FuncLimit_OpenDay", config.OpenDay), |
| | | Language.Get("FuncLimitOpen1")); |
| | | } |
| | | case 3: |
| | | return StringUtility.Contact( |
| | | Language.Get("FuncLimit_Realm", RealmConfig.Get(config.LimiRealmLV).Name), |
| | | Language.Get("FuncLimitOpen1")); |
| | | case 4: |
| | | return StringUtility.Contact( |
| | | Language.Get("FuncLimit_Mission", TaskManager.Instance.GetNeedFinishTaskCount(config.LimitMissionID)), |
| | | Language.Get("FuncLimitOpen1")); |
| | | } |
| | | } |
| | | return string.Empty; |
| | | } |
| | | |
| | | public int GetLimitLv(int key) |
| | | { |
| | | // FuncOpenLVConfig tagFuncOpenLVModel = FuncOpenLVConfig.Get(key); |
| | |
| | | if (!UIManager.Instance.IsOpened<HomeWin>()) |
| | | return; |
| | | |
| | | |
| | | if (UIManager.Instance.IsOpened(popupWindowQueue[0].window)) |
| | | { |
| | | //当前模式可以打开多个相同窗口,增加防范 |
| | | return; |
| | | } |
| | | |
| | | if (UIManager.Instance.ExistAnyFullScreenOrMaskWin(popupWindowQueue[0].window)) |
| | | return; |
| | | |
| | | if (currentWindow.window != null) |
| | | { |
| | | //判断上一个推送是否关闭 |
| | |
| | | |
| | | var width = image.rectTransform.rect.width; |
| | | var height = image.rectTransform.rect.height; |
| | | var outerArea = new Vector2(0.5f * width,0.5f * height); |
| | | var outerArea = new Vector2(0.5f * width, 0.5f * height); |
| | | |
| | | var realCenter = new Vector2(Mathf.Clamp(center.x,-width * 0.5f + cell.x,width * 0.5f - cell.x), |
| | | Mathf.Clamp(center.y,-height * 0.5f + cell.y,height * 0.5f - cell.y)); |
| | | // var realCenter = new Vector2(Mathf.Clamp(center.x,-width * 0.5f + cell.x,width * 0.5f - cell.x), |
| | | // Mathf.Clamp(center.y,-height * 0.5f + cell.y,height * 0.5f - cell.y)); |
| | | |
| | | var realCenter = center; |
| | | |
| | | var uv = image.overrideSprite != null ? DataUtility.GetOuterUV(image.overrideSprite) : Vector4.zero; |
| | | |
| | | var uvCenterX = (uv.x + uv.z) * 0.5f; |
| | | var uvCenterY = (uv.y + uv.w) * 0.5f; |
| | | var uvScaleX = (uv.z - uv.x) / width; |
| | |
| | |
|
| | | // 加载配置文件
|
| | | HashSet<Type> configTypes = new HashSet<Type>() {
|
| | | typeof(ADAwardConfig),
|
| | | typeof(ChestsAwardConfig),
|
| | | typeof(CTGConfig),
|
| | | typeof(DamageNumConfig),
|
| | | typeof(DirtyWordConfig),
|
| | | typeof(DungeonConfig),
|
| | | typeof(DungeonOpenTimeConfig),
|
| | | typeof(FaceConfig),
|
| | | typeof(FightPowerRatioConfig),
|
| | | typeof(FirstChargeConfig),
|
| | |
| | |
|
| | | public override void Release()
|
| | | {
|
| | | // 清空 ADAwardConfig 字典
|
| | | ClearConfigDictionary<ADAwardConfig>();
|
| | | // 清空 ChestsAwardConfig 字典
|
| | | ClearConfigDictionary<ChestsAwardConfig>();
|
| | | // 清空 CTGConfig 字典
|
| | |
| | | ClearConfigDictionary<DamageNumConfig>();
|
| | | // 清空 DirtyWordConfig 字典
|
| | | ClearConfigDictionary<DirtyWordConfig>();
|
| | | // 清空 DungeonConfig 字典
|
| | | ClearConfigDictionary<DungeonConfig>();
|
| | | // 清空 DungeonOpenTimeConfig 字典
|
| | | ClearConfigDictionary<DungeonOpenTimeConfig>();
|
| | | // 清空 FaceConfig 字典
|
| | | ClearConfigDictionary<FaceConfig>();
|
| | | // 清空 FightPowerRatioConfig 字典
|
New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2025年10月9日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class ADAwardConfig : ConfigBase<int, ADAwardConfig> |
| | | { |
| | | static ADAwardConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int ADID; |
| | | public int ADCntMax; |
| | | public int[][] ADAwardItemList; |
| | | public int ADMapID; |
| | | |
| | | 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 ADID); |
| | | |
| | | int.TryParse(tables[1],out ADCntMax); |
| | | |
| | | ADAwardItemList = JsonMapper.ToObject<int[][]>(tables[2].Replace("(", "[").Replace(")", "]")); |
| | | |
| | | int.TryParse(tables[3],out ADMapID); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/Config/Configs/ADAwardConfig.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 58245db2532a8194bb46fcdd9c7cb783 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: Thursday, October 9, 2025 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class DungeonConfig : ConfigBase<int, DungeonConfig> |
| | | { |
| | | static DungeonConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int ID; |
| | | public int DataMapID; |
| | | public int LineID; |
| | | public int LVLimitMin; |
| | | public int[][] PassAwardList; |
| | | public int[][] SweepAwardList; |
| | | public int[] LineupIDList; |
| | | public int NPCLV; |
| | | public float Difficulty; |
| | | public long FightPower; |
| | | |
| | | 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 DataMapID); |
| | | |
| | | int.TryParse(tables[2],out LineID); |
| | | |
| | | int.TryParse(tables[3],out LVLimitMin); |
| | | |
| | | PassAwardList = JsonMapper.ToObject<int[][]>(tables[4].Replace("(", "[").Replace(")", "]")); |
| | | |
| | | SweepAwardList = JsonMapper.ToObject<int[][]>(tables[5].Replace("(", "[").Replace(")", "]")); |
| | | |
| | | if (tables[6].Contains("[")) |
| | | { |
| | | LineupIDList = JsonMapper.ToObject<int[]>(tables[6]); |
| | | } |
| | | else |
| | | { |
| | | string[] LineupIDListStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | LineupIDList = new int[LineupIDListStringArray.Length]; |
| | | for (int i=0;i<LineupIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(LineupIDListStringArray[i],out LineupIDList[i]); |
| | | } |
| | | } |
| | | |
| | | int.TryParse(tables[7],out NPCLV); |
| | | |
| | | float.TryParse(tables[8],out Difficulty); |
| | | |
| | | long.TryParse(tables[9],out FightPower); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/Config/Configs/DungeonConfig.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 9ae93b5f387064c48a7145a724c1cb1d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2025年10月9日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class DungeonOpenTimeConfig : ConfigBase<int, DungeonOpenTimeConfig> |
| | | { |
| | | static DungeonOpenTimeConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int DataMapID; |
| | | public string FBName; |
| | | public int DayTimes; |
| | | public int PayCntMax; |
| | | public int PayMoneyType; |
| | | public int[] PayMoneyValues; |
| | | |
| | | 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 DataMapID); |
| | | |
| | | FBName = tables[1]; |
| | | |
| | | int.TryParse(tables[2],out DayTimes); |
| | | |
| | | int.TryParse(tables[3],out PayCntMax); |
| | | |
| | | int.TryParse(tables[4],out PayMoneyType); |
| | | |
| | | if (tables[5].Contains("[")) |
| | | { |
| | | PayMoneyValues = JsonMapper.ToObject<int[]>(tables[5]); |
| | | } |
| | | else |
| | | { |
| | | string[] PayMoneyValuesStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | PayMoneyValues = new int[PayMoneyValuesStringArray.Length]; |
| | | for (int i=0;i<PayMoneyValuesStringArray.Length;i++) |
| | | { |
| | | int.TryParse(PayMoneyValuesStringArray[i],out PayMoneyValues[i]); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/Config/Configs/DungeonOpenTimeConfig.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 70933c16af3ce7c4e8465995422fdc20 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年10月9日
|
| | | // [ Date ]: 2025年10月11日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public string WinName;
|
| | | public int PreGuideId;
|
| | | public int[] Steps;
|
| | | public int NoRecord;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | |
| | | int.TryParse(StepsStringArray[i],out Steps[i]); |
| | | } |
| | | }
|
| | |
|
| | | int.TryParse(tables[7],out NoRecord); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
New file |
| | |
| | | using System.Collections.Generic; |
| | | public partial class ADAwardConfig : ConfigBase<int, ADAwardConfig> |
| | | { |
| | | private static Dictionary<int, int> idDict = new Dictionary<int, int>(); |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | idDict[ADMapID] = ADID; |
| | | } |
| | | public static bool TryGetADIDByADMapID(int ADMapID, out int ADID) |
| | | { |
| | | return idDict.TryGetValue(ADMapID, out ADID) && ADID > 0; |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/Config/PartialConfigs/ADAwardConfig.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: d2ce6f478897b7f448e77181bfe1c30c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | |
| | | |
| | | using System.Collections.Generic; |
| | | |
| | | public partial class DungeonConfig : ConfigBase<int, DungeonConfig> |
| | | { |
| | | private static Dictionary<int, Dictionary<int, int>> dungeonIndexDict = new Dictionary<int, Dictionary<int, int>>(); |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!dungeonIndexDict.ContainsKey(DataMapID)) |
| | | dungeonIndexDict[DataMapID] = new Dictionary<int, int>(); |
| | | dungeonIndexDict[DataMapID][LineID] = ID; |
| | | } |
| | | |
| | | public static bool TryGetDungeonID(int mapID, int lineID, out int dungeonID) |
| | | { |
| | | dungeonID = 0; |
| | | return dungeonIndexDict.TryGetValue(mapID, out var dict) && dict.TryGetValue(lineID, out dungeonID); |
| | | } |
| | | |
| | | public static Dictionary<int, Dictionary<int, int>> GetDungeonIndexDict() |
| | | { |
| | | return dungeonIndexDict; |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/Config/PartialConfigs/DungeonConfig.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 772733fef93f97a44a533b8a0cb581d8 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //A5 05 玩家开始副本扫荡 #tagCMBeginFBWipeOut |
| | | |
| | | public class CA505_tagCMBeginFBWipeOut : GameNetPackBasic { |
| | | public uint MapID; |
| | | public ushort LineID; |
| | | public byte Cnt; // 扫荡次数 |
| | | public uint DataEx; //附带信息 |
| | | |
| | | public CA505_tagCMBeginFBWipeOut () { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xA505; |
| | | } |
| | | |
| | | public override void WriteToBytes () { |
| | | WriteBytes (MapID, NetDataType.DWORD); |
| | | WriteBytes (LineID, NetDataType.WORD); |
| | | WriteBytes (Cnt, NetDataType.BYTE); |
| | | WriteBytes (DataEx, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/Core/NetworkPackage/ClientPack/CA5_Function/CA505_tagCMBeginFBWipeOut.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 84b77d2d7dc7a8a4c8b7444ad736fb32 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //A5 75 购买副本进入次数#tagCMBuyEnterCount |
| | | |
| | | public class CA575_tagCMBuyEnterCount : GameNetPackBasic { |
| | | public uint FBID; // 副本ID |
| | | |
| | | public CA575_tagCMBuyEnterCount () { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xA575; |
| | | } |
| | | |
| | | public override void WriteToBytes () { |
| | | WriteBytes (FBID, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/Core/NetworkPackage/ClientPack/CA5_Function/CA575_tagCMBuyEnterCount.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 7429b3dc8036bc14683b9b61fd99b5ce |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //03 20 副本结束界面#tagFBEnd |
| | | |
| | | public class DTC0320_tagFBEnd : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | H0320_tagFBEnd vNetData = vNetPack as H0320_tagFBEnd; |
| | | BoneFieldManager.Instance.UpdateFBEnd(vNetData); |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter/DTC0320_tagFBEnd.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 54b386c0b723a164e91c93600ecb8711 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A3 20 玩家副本相关信息 #tagSCFBInfoList |
| | | |
| | | public class DTCA320_tagSCFBInfoList : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | HA320_tagSCFBInfoList vNetData = vNetPack as HA320_tagSCFBInfoList; |
| | | DungeonManager.Instance.UpdateFBInfoList(vNetData); |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagSCFBInfoList.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 84dc35982f18cad45aac9a2b90869ebd |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | {
|
| | | base.Done(vNetPack);
|
| | | HA3BD_tagMCBuyEnterInfo vNetData = vNetPack as HA3BD_tagMCBuyEnterInfo;
|
| | | DungeonModel.Instance.UpdateRecords(vNetData.FBInfo);
|
| | | DungeonManager.Instance.UpdateRecords(vNetData.FBInfo);
|
| | | }
|
| | | }
|
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A7 22 广告信息列表 #tagSCADInfoList |
| | | |
| | | public class DTCA722_tagSCADInfoList : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | HA722_tagSCADInfoList vNetData = vNetPack as HA722_tagSCADInfoList; |
| | | AdsManager.Instance.UpdateAdsInfoList(vNetData); |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA722_tagSCADInfoList.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: abc4ee77ef8582c41a1af696e0b18ea4 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | Register(typeof(HAA02_tagSCFirstChargeInfo), typeof(DTCAA02_tagSCFirstChargeInfo)); |
| | | Register(typeof(HAA03_tagMCDailyPackBuyGiftInfo), typeof(DTCAA03_tagMCDailyPackBuyGiftInfo)); |
| | | Register(typeof(HA302_tagMCFuncOpenStateList), typeof(DTCA302_tagMCFuncOpenStateList)); |
| | | Register(typeof(HA320_tagMCPlayerFBInfoData), typeof(DTCA320_tagMCPlayerFBInfoData)); |
| | | Register(typeof(HA320_tagSCFBInfoList), typeof(DTCA320_tagSCFBInfoList)); |
| | | Register(typeof(H0F03_tagRoleFamilyInfo), typeof(DTC0F03_tagRoleFamilyInfo)); |
| | | Register(typeof(H0F05_tagFamilyChange), typeof(DTC0F05_tagFamilyChange)); |
| | | Register(typeof(H0F07_tagFamilyRenameResult), typeof(DTC0F07_tagFamilyRenameResult)); |
| | |
| | | Register(typeof(HB123_tagSCDropBootyInfo), typeof(DTCB123_tagSCDropBootyInfo)); |
| | | Register(typeof(HB036_tagSCGoldRushInfo), typeof(DTCB036_tagSCGoldRushInfo)); |
| | | Register(typeof(HB037_tagSCGoldRushCampInfo), typeof(DTCB037_tagSCGoldRushCampInfo)); |
| | | Register(typeof(HA722_tagSCADInfoList), typeof(DTCA722_tagSCADInfoList)); |
| | | Register(typeof(H0320_tagFBEnd), typeof(DTC0320_tagFBEnd)); |
| | | |
| | | } |
| | | |
| | | //主工程注册封包 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //03 20 副本结束界面#tagFBEnd |
| | | |
| | | public class H0320_tagFBEnd : GameNetPackBasic { |
| | | public ushort Len; |
| | | public string Msg; //size = Len |
| | | |
| | | public H0320_tagFBEnd () { |
| | | _cmd = (ushort)0x0320; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out Len, vBytes, NetDataType.WORD); |
| | | TransBytes (out Msg, vBytes, NetDataType.Chars, Len); |
| | | } |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/H03_MainCharacter/H0320_tagFBEnd.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 937362d4f44267349a0e6caf03f53599 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A3 20 玩家副本相关信息 #tagSCFBInfoList |
| | | |
| | | public class HA320_tagSCFBInfoList : GameNetPackBasic { |
| | | public byte FBDataCnt; // 副本数据个数 |
| | | public tagSCFBInfo[] FBDataList; // 副本数据列表 |
| | | |
| | | public HA320_tagSCFBInfoList () { |
| | | _cmd = (ushort)0xA320; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out FBDataCnt, vBytes, NetDataType.BYTE); |
| | | FBDataList = new tagSCFBInfo[FBDataCnt]; |
| | | for (int i = 0; i < FBDataCnt; i ++) { |
| | | FBDataList[i] = new tagSCFBInfo(); |
| | | TransBytes (out FBDataList[i].MapID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FBDataList[i].EnterCnt, vBytes, NetDataType.WORD); |
| | | TransBytes (out FBDataList[i].ADAddCnt, vBytes, NetDataType.BYTE); |
| | | TransBytes (out FBDataList[i].BuyAddCnt, vBytes, NetDataType.BYTE); |
| | | TransBytes (out FBDataList[i].ItemAddCnt, vBytes, NetDataType.WORD); |
| | | TransBytes (out FBDataList[i].PassLineID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FBDataList[i].PassGradeCnt, vBytes, NetDataType.BYTE); |
| | | TransBytes (out FBDataList[i].PassGrade, vBytes, NetDataType.DWORD, FBDataList[i].PassGradeCnt); |
| | | } |
| | | } |
| | | |
| | | public class tagSCFBInfo { |
| | | public uint MapID; |
| | | public ushort EnterCnt; //今日累计进入次数 |
| | | public byte ADAddCnt; //广告增加次数 |
| | | public byte BuyAddCnt; //购买增加次数 |
| | | public ushort ItemAddCnt; //物品增加次数 |
| | | public uint PassLineID; //已过关到的lineID |
| | | public byte PassGradeCnt; //星级值对应个数, 每个key存9个lineID |
| | | public uint[] PassGrade; //副本线路对应星级值列表 |
| | | } |
| | | |
| | | } |
File was renamed from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 09d1d01f36bbc4642bf12e6e209dc82f |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A7 22 广告信息列表 #tagSCADInfoList |
| | | |
| | | public class HA722_tagSCADInfoList : GameNetPackBasic { |
| | | public byte Count; |
| | | public tagSCADInfo[] ADInfoList; |
| | | |
| | | public HA722_tagSCADInfoList () { |
| | | _cmd = (ushort)0xA722; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out Count, vBytes, NetDataType.BYTE); |
| | | ADInfoList = new tagSCADInfo[Count]; |
| | | for (int i = 0; i < Count; i ++) { |
| | | ADInfoList[i] = new tagSCADInfo(); |
| | | TransBytes (out ADInfoList[i].ADID, vBytes, NetDataType.WORD); |
| | | TransBytes (out ADInfoList[i].ADCnt, vBytes, NetDataType.BYTE); |
| | | } |
| | | } |
| | | |
| | | public class tagSCADInfo { |
| | | public ushort ADID; //广告ID |
| | | public byte ADCnt; //今日已领取广告奖励次数 |
| | | } |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA7_Interaction/HA722_tagSCADInfoList.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 8c08b65a13f9abc4d852129082d6615c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | managers.Add(GMCmdManager.Instance);
|
| | | managers.Add(FairyEmblemModel.Instance);
|
| | | managers.Add(EquipModel.Instance);
|
| | | managers.Add(DungeonModel.Instance);
|
| | | managers.Add(DungeonManager.Instance);
|
| | | managers.Add(DailyQuestModel.Instance);
|
| | | managers.Add(CustomizedRechargeModel.Instance);
|
| | | managers.Add(CustomizedGiftModel.Instance);
|
| | |
| | | managers.Add(MainLevelManager.Instance);
|
| | | managers.Add(BattleSettlementManager.Instance);
|
| | | managers.Add(GoldRushManager.Instance);
|
| | | managers.Add(MailManager.Instance);
|
| | | managers.Add(FirstChargeManager.Instance);
|
| | | managers.Add(NewBieCenter.Instance);
|
| | | |
| | | managers.Add(AdsManager.Instance);
|
| | | managers.Add(BoneFieldManager.Instance);
|
| | |
|
| | | foreach (var manager in managers)
|
| | | {
|
| | | manager.Init();
|
| | |
| | | public bool IsOpened(string uiName) |
| | | { |
| | | UIBase ui = GetUI(uiName); |
| | | |
| | | |
| | | if (null != ui) |
| | | { |
| | | return ui.IsActive(); |
| | | } |
| | | |
| | | |
| | | return false; |
| | | } |
| | | |
| | | // 检查是否存在任何全屏或遮罩窗口, 暂未定义全屏可以统一勾选openMask |
| | | public bool ExistAnyFullScreenOrMaskWin(string excludeUIName) |
| | | { |
| | | var exist = false; |
| | | foreach (var uiList in uiDict.Values) |
| | | { |
| | | // 遍历该类型的所有UI实例 |
| | | foreach (var ui in uiList) |
| | | { |
| | | // 刷新UI |
| | | if (ui.IsActive() && ui.name != excludeUIName) |
| | | { |
| | | if (ui.openMask) |
| | | { |
| | | exist = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return exist; |
| | | } |
| | | |
| | | // 获取指定类型的所有UI实例 |
| | | public List<T> GetAllUI<T>() where T : UIBase |
| | | { |
| | |
| | | } |
| | | set |
| | | { |
| | | m_IsPause = value; |
| | | |
| | | if (m_IsPause) |
| | | if (value) |
| | | { |
| | | m_IsPause = value; |
| | | PauseGame(); |
| | | OnBattlePause?.Invoke(m_IsPause); |
| | | } |
| | | else |
| | | { |
| | | ResumeGame(); |
| | | if (CanResumeGame()) |
| | | { |
| | | m_IsPause = value; |
| | | ResumeGame(); |
| | | OnBattlePause?.Invoke(m_IsPause); |
| | | } |
| | | } |
| | | |
| | | OnBattlePause?.Invoke(m_IsPause); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | recordPlayer.ForceFinish(); |
| | | } |
| | | |
| | | |
| | | //暂停的原因有很多,需要检查各种状态 |
| | | bool CanResumeGame() |
| | | { |
| | | if (UIManager.Instance.IsOpened<NewBieWin>()) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (UIManager.Instance.IsOpened<EquipExchangeWin>()) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using LitJson; |
| | | using UnityEngine; |
| | | using System.Collections.Generic; |
| | | |
| | | |
| | | public class StoryBoneBattleField : BattleField |
| | | { |
| | | protected int chapter;// 章节 |
| | | protected int wave;// 波数 |
| | | protected int level;// 关卡 |
| | | protected JsonData extendData; |
| | | |
| | | protected MainChapterConfig chapterConfig; |
| | | |
| | | protected MainLevelConfig levelConfig; |
| | | |
| | | |
| | | public StoryBoneBattleField(string _guid) : base(_guid) |
| | | { |
| | | |
| | | } |
| | | |
| | | public override void Init(int MapID, int FuncLineID, JsonData _extendData, |
| | | List<TeamBase> _redTeamList, List<TeamBase> _blueTeamList) |
| | | { |
| | | base.Init(MapID, FuncLineID, extendData, _redTeamList, _blueTeamList); |
| | | |
| | | chapter = FuncLineID / 10000; |
| | | wave = MapID == 1 ? FuncLineID % 100 : 1;//第几波怪 |
| | | level = (FuncLineID % 10000) / 100; |
| | | |
| | | extendData = _extendData; |
| | | chapterConfig = MainChapterConfig.Get(chapter); |
| | | levelConfig = MainLevelConfig.Get(level); |
| | | |
| | | SetBattleMode(BattleMode.Record); |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | base.Release(); |
| | | } |
| | | |
| | | |
| | | public override void AutoSetBattleMode() |
| | | { |
| | | SetBattleMode(BattleMode.Record); |
| | | } |
| | | |
| | | public override void TurnFightState(int TurnNum, int State, |
| | | uint FuncLineID, JsonData extendData) |
| | | { |
| | | base.TurnFightState(TurnNum, State, FuncLineID, extendData); |
| | | |
| | | switch (State) |
| | | { |
| | | // 起始状态标记 |
| | | case 0: |
| | | break; |
| | | case 1://准备完毕 |
| | | break; |
| | | case 2://战斗中 |
| | | break; |
| | | case 3://战斗结束 |
| | | break; |
| | | case 4://结算奖励 |
| | | break; |
| | | case 5://结束状态标记 |
| | | break; |
| | | default: |
| | | BattleDebug.LogError("recieve a unknown State"); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | protected override void OnSettlement(JsonData turnFightStateData) |
| | | { |
| | | base.OnSettlement(turnFightStateData); |
| | | } |
| | | |
| | | public override void WhaleFall() |
| | | { |
| | | UIManager.Instance.CloseWindow<FullScreenBattleWin>(); |
| | | AutoFightModel.Instance.isPause = false; |
| | | UIManager.Instance.OpenWindow<BoneFieldWin>(); |
| | | Destroy(); |
| | | } |
| | | |
| | | |
| | | |
| | | public override void HaveRest() |
| | | { |
| | | // 主线BOSS战斗没有休息 |
| | | } |
| | | |
| | | |
| | | // public override void OnBattleEnd(JsonData turnFightStateData) |
| | | // { |
| | | // base.OnBattleEnd(turnFightStateData); |
| | | // // HaveRest(); |
| | | // } |
| | | |
| | | public override void Run() |
| | | { |
| | | if (operationAgent == null) |
| | | { |
| | | //防范异常 |
| | | return; |
| | | } |
| | | base.Run(); |
| | | } |
| | | |
| | | public override void DistributeNextPackage() |
| | | { |
| | | if (IsBattleFinish) |
| | | return; |
| | | |
| | | // 不要调用base的函数 |
| | | BattleManager.Instance.DistributeNextReportPackage(guid); |
| | | } |
| | | |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/System/Battle/BattleField/StoryBoneBattleField.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 9e1d86ce80ddb05498e956a42cef8b33 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | |
| | | switch (MapID) |
| | | { |
| | | case 1: |
| | | battleField = new StoryBattleField(); |
| | | break; |
| | | case 2: |
| | | case 1: |
| | | battleField = new StoryBattleField(); |
| | | break; |
| | | case 2: |
| | | battleField = new StoryBossBattleField(guid); |
| | | break; |
| | | default: |
| | | break; |
| | | case 30010: |
| | | battleField = new StoryBoneBattleField(guid); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | return battleField; |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2771fb42327cbe54ab2401a146d7e659 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | public class AdsManager : GameSystemManager<AdsManager> |
| | | { |
| | | //<广告ID,今日已领取广告奖励次数> |
| | | private Dictionary<int, int> adsInfoDict = new Dictionary<int, int>(); |
| | | public event Action<int,int> OnAdsInfoListUpdateEvent;//ADID ADMapID |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitializeEvent; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitializeEvent; |
| | | } |
| | | |
| | | public void OnBeforePlayerDataInitializeEvent() |
| | | { |
| | | adsInfoDict.Clear(); |
| | | } |
| | | |
| | | public void SendGetReward(int ADID) |
| | | { |
| | | var pack = new CA504_tagCMPlayerGetReward(); |
| | | pack.RewardType = 81; // 广告奖励 81 |
| | | pack.DataEx = (uint)ADID; // 广告奖励ID |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | public void PlayAds(int ADID) |
| | | { |
| | | if (ADID == 1) |
| | | { |
| | | |
| | | int dataMapID = BoneFieldManager.Instance.DataMapID; |
| | | if (!DungeonManager.Instance.TryGetFBInfoByMapID(dataMapID, out var fbInfo)) |
| | | return; |
| | | SendGetReward(ADID); |
| | | BoneFieldManager.Instance.SendBBeginFBWipeOut(dataMapID, (int)fbInfo.PassLineID); |
| | | } |
| | | |
| | | } |
| | | |
| | | public int GetADCntByADID(int ADID) |
| | | { |
| | | if (adsInfoDict.IsNullOrEmpty() || !adsInfoDict.ContainsKey(ADID)) |
| | | return 0; |
| | | return adsInfoDict[ADID]; |
| | | } |
| | | |
| | | public void UpdateAdsInfoList(HA722_tagSCADInfoList vNetData) |
| | | { |
| | | if (vNetData == null || vNetData.ADInfoList.IsNullOrEmpty()) |
| | | return; |
| | | foreach (var item in vNetData.ADInfoList) |
| | | { |
| | | adsInfoDict[item.ADID] = item.ADCnt; |
| | | |
| | | int mapID = 0; |
| | | if (ADAwardConfig.HasKey(item.ADID)) |
| | | { |
| | | ADAwardConfig aDAwardConfig = ADAwardConfig.Get(item.ADID); |
| | | mapID = aDAwardConfig.ADMapID; |
| | | } |
| | | OnAdsInfoListUpdateEvent?.Invoke(item.ADID, mapID); |
| | | } |
| | | } |
| | | } |
| | | |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/System/BoneField/AdsManager.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: fd600b8da29646b4a8aa0cb5dabdb5f8 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class BoneFieldChallengeButton : MonoBehaviour |
| | | { |
| | | [SerializeField] ButtonEx btnChallenge; |
| | | [SerializeField] TextEx txtChallengeLv; |
| | | [SerializeField] TextEx txtChallengeYes; |
| | | [SerializeField] TextEx txtChallengeNo; |
| | | [SerializeField] ImageEx imgChallengeLVYes; |
| | | [SerializeField] ImageEx imgChallengeLVNo; |
| | | [SerializeField] ImageEx imgChallengeIcon; |
| | | [SerializeField] ImageEx imgChallengeRed; |
| | | bool isLvOk; |
| | | int lvLimitMin; |
| | | bool isHasNextLineID; |
| | | public void Awake() |
| | | { |
| | | btnChallenge.SetListener(OnClickChallenge); |
| | | } |
| | | public void Display(int lvLimitMin, bool isHasNextLineID, long bossFightPower) |
| | | { |
| | | this.isHasNextLineID = isHasNextLineID; |
| | | this.lvLimitMin = lvLimitMin; |
| | | isLvOk = PlayerDatas.Instance.baseData.LV >= lvLimitMin; |
| | | long myFightPower = PlayerDatas.Instance.baseData.FightPower; |
| | | imgChallengeRed.SetActive(isLvOk && isHasNextLineID && myFightPower >= bossFightPower); |
| | | txtChallengeLv.SetActive(!isLvOk); |
| | | txtChallengeLv.text = Language.Get("BoneField07", lvLimitMin); |
| | | txtChallengeYes.SetActive(isLvOk && isHasNextLineID); |
| | | txtChallengeNo.SetActive(!isLvOk || !isHasNextLineID); |
| | | imgChallengeLVYes.SetActive(isLvOk && isHasNextLineID); |
| | | imgChallengeLVNo.SetActive(!isLvOk || !isHasNextLineID); |
| | | imgChallengeIcon.SetActive(isLvOk && isHasNextLineID); |
| | | } |
| | | private void OnClickChallenge() |
| | | { |
| | | if (!isLvOk) |
| | | { |
| | | // %s0级可挑战 |
| | | SysNotifyMgr.Instance.ShowTip("BoneField01", lvLimitMin); |
| | | return; |
| | | } |
| | | if (!isHasNextLineID) |
| | | { |
| | | // 已到达最高层 |
| | | SysNotifyMgr.Instance.ShowTip("BoneField02", lvLimitMin); |
| | | return; |
| | | } |
| | | if (!DungeonManager.Instance.TryGetFBInfoByMapID(BoneFieldManager.Instance.DataMapID, out var fbInfo)) |
| | | return; |
| | | int nowPassLineID = BoneFieldManager.Instance.GetNowPassLineID(fbInfo); |
| | | BoneFieldManager.Instance.SendTurnFight(BoneFieldManager.Instance.DataMapID, nowPassLineID); |
| | | UIManager.Instance.CloseWindow<BoneFieldWin>(); |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/System/BoneField/BoneFieldChallengeButton.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 7d146ab81b1eaa9429ab8f0a53fb5485 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using DG.DemiEditor; |
| | | using LitJson; |
| | | public class BoneFieldManager : GameSystemManager<BoneFieldManager> |
| | | { |
| | | |
| | | public readonly int DataMapID = 30010; // 白骨盈野(战锤秘境) |
| | | public readonly int MinStartLineID = 1; // funcLineID从1开始 |
| | | public readonly int funcId = 9; //功能ID |
| | | public Redpoint parentRedpoint = new Redpoint(MainRedDot.MainChallengeRedpoint, MainRedDot.BoneFieldRepoint); |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitializeEvent; |
| | | DungeonManager.Instance.UpdateFBInfoChangeEvent += OnUpdateFBInfoChangeEvent; |
| | | AdsManager.Instance.OnAdsInfoListUpdateEvent += OnAdsInfoListUpdateEvent; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; |
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitializeEvent; |
| | | DungeonManager.Instance.UpdateFBInfoChangeEvent -= OnUpdateFBInfoChangeEvent; |
| | | AdsManager.Instance.OnAdsInfoListUpdateEvent -= OnAdsInfoListUpdateEvent; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent; |
| | | TimeMgr.Instance.OnDayEvent -= OnDayEvent; |
| | | } |
| | | |
| | | private void OnFuncStateChangeEvent(int obj) |
| | | { |
| | | if (obj != funcId) |
| | | return; |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | private void OnDayEvent() |
| | | { |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | private void OnUpdateFBInfoChangeEvent(int mapID, bool isADAddCntChange, bool isBuyAddCntChange, bool isItemAddCntChange) |
| | | { |
| | | int dataMapID = DataMapID; |
| | | if (mapID != dataMapID) |
| | | return; |
| | | if (isADAddCntChange) |
| | | return; |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | private void OnAdsInfoListUpdateEvent(int id, int mapId) |
| | | { |
| | | if (mapId != DataMapID) |
| | | return; |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | public void OnBeforePlayerDataInitializeEvent() |
| | | { |
| | | //mailDataDict.Clear(); |
| | | } |
| | | |
| | | public void UpdateRedPoint() |
| | | { |
| | | parentRedpoint.state = RedPointState.None; |
| | | if (!FuncOpen.Instance.IsFuncOpen(funcId)) |
| | | return; |
| | | if (!DungeonManager.Instance.TryGetFBInfoByMapID(DataMapID, out var fbInfo)) |
| | | return; |
| | | bool isHasNextLineID = IsHasNextLineID(fbInfo); |
| | | int nowPassLineID = GetNowPassLineID(fbInfo); |
| | | DungeonConfig.TryGetDungeonID(DataMapID, nowPassLineID, out int dungeonID); |
| | | if (!DungeonConfig.HasKey(dungeonID)) |
| | | return; |
| | | DungeonConfig dungeonConfig = DungeonConfig.Get(dungeonID); |
| | | bool isLvOk = PlayerDatas.Instance.baseData.LV >= dungeonConfig.LVLimitMin; |
| | | long myFightPower = PlayerDatas.Instance.baseData.FightPower; |
| | | if (myFightPower >= dungeonConfig.FightPower) |
| | | { |
| | | if (isLvOk && isHasNextLineID) |
| | | { |
| | | parentRedpoint.state = RedPointState.Simple; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (TryGetShowSweepCount(out int showSweepMaxCount, out int showrealRemainSweepCount)) |
| | | { |
| | | bool isSweepCountOk = showrealRemainSweepCount > 0; |
| | | if (isSweepCountOk) |
| | | { |
| | | parentRedpoint.state = RedPointState.Simple; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public bool IsHasNextLineID(FBInfo fBInfo) |
| | | { |
| | | int passLineID = (int)fBInfo.PassLineID; |
| | | int nextPassLineID = passLineID + 1; |
| | | return DungeonConfig.TryGetDungeonID(DataMapID, nextPassLineID, out int dungeonID); |
| | | } |
| | | |
| | | public int GetNowPassLineID(FBInfo fBInfo) |
| | | { |
| | | int passLineID = (int)fBInfo.PassLineID; |
| | | if (passLineID < MinStartLineID) |
| | | return MinStartLineID; |
| | | int nextPassLineID = passLineID + 1; |
| | | if (!DungeonConfig.TryGetDungeonID(DataMapID, nextPassLineID, out int nextDungeonID)) |
| | | return passLineID; |
| | | return nextPassLineID; |
| | | } |
| | | |
| | | public bool TryGetShowSweepCount(out int showSweepMaxCount, out int showrealRemainSweepCount) |
| | | { |
| | | showSweepMaxCount = 0; |
| | | showrealRemainSweepCount = 0; |
| | | int dataMapID = BoneFieldManager.Instance.DataMapID; |
| | | if (!DungeonOpenTimeConfig.HasKey(dataMapID)) |
| | | return false; |
| | | if (!DungeonManager.Instance.TryGetFBInfoByMapID(dataMapID, out FBInfo fbInfo)) |
| | | return false; |
| | | DungeonOpenTimeConfig dungeonOpenTimeConfig = DungeonOpenTimeConfig.Get(dataMapID); |
| | | |
| | | int baseCount = dungeonOpenTimeConfig.DayTimes + dungeonOpenTimeConfig.PayCntMax; |
| | | int realMaxCount = baseCount + fbInfo.ADAddCnt + fbInfo.BuyAddCnt + fbInfo.ItemAddCnt; |
| | | int realRemainSweepCount = realMaxCount - fbInfo.EnterCnt; |
| | | |
| | | showSweepMaxCount = realMaxCount - fbInfo.ADAddCnt - fbInfo.BuyAddCnt; |
| | | showrealRemainSweepCount = realRemainSweepCount - fbInfo.BuyAddCnt; |
| | | return true; |
| | | } |
| | | |
| | | public void SendTurnFight(int mapID, int funcLineID) |
| | | { |
| | | CB410_tagCMTurnFight pack = new CB410_tagCMTurnFight(); |
| | | pack.MapID = (uint)mapID; |
| | | pack.FuncLineID = (uint)funcLineID; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | public void SendBBeginFBWipeOut(int mapID, int lineID) |
| | | { |
| | | CA505_tagCMBeginFBWipeOut pack = new CA505_tagCMBeginFBWipeOut(); |
| | | pack.MapID = (uint)mapID; |
| | | pack.LineID = (ushort)lineID; |
| | | pack.Cnt = 1; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | |
| | | |
| | | public void SendBuyEnterCount(int FBID) |
| | | { |
| | | var pack = new CA575_tagCMBuyEnterCount(); |
| | | pack.FBID = (uint)FBID; // 副本ID |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | public void UpdateFBEnd(H0320_tagFBEnd vNetData) |
| | | { |
| | | if (vNetData.Msg.IsNullOrEmpty()) |
| | | return; |
| | | ChallengeResultData result = ChallengeResultData.FromJson(vNetData.Msg); |
| | | if (result == null || result.itemInfo.IsNullOrEmpty()) |
| | | return; |
| | | if (result.dataMapID != DataMapID) |
| | | return; |
| | | List<Item> showItems = new List<Item>(); |
| | | foreach (var item in result.itemInfo) |
| | | { |
| | | Item tempItem = new Item(item.ItemID, item.Count); |
| | | showItems.Add(tempItem); |
| | | } |
| | | ItemLogicUtility.Instance.ShowGetItem(showItems); |
| | | } |
| | | |
| | | public class ItemInfo |
| | | { |
| | | public int ItemID { get; set; } |
| | | public int Count { get; set; } |
| | | } |
| | | |
| | | public class ChallengeResultData |
| | | { |
| | | public int dataMapID { get; set; } |
| | | public List<ItemInfo> itemInfo { get; set; } |
| | | public int lineID { get; set; } |
| | | public int isPass { get; set; } |
| | | public int isSweep { get; set; } |
| | | |
| | | public static ChallengeResultData FromJson(string json) |
| | | { |
| | | return JsonMapper.ToObject<ChallengeResultData>(json); |
| | | } |
| | | } |
| | | } |
| | | |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/System/BoneField/BoneFieldManager.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 77bb3f7eaa082d34ea9ec3678a728a06 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | public class BoneFieldWin : UIBase |
| | | { |
| | | [SerializeField] TextEx txtDifficulty; |
| | | [SerializeField] TextEx txtBossName; |
| | | [SerializeField] TextEx txtTodaySweepCount; |
| | | [SerializeField] TextEx txtTodayAdsCount; |
| | | [SerializeField] TextEx txtFirstFree; |
| | | [SerializeField] TextEx txtFightPower; |
| | | [SerializeField] ImageEx imgMaxLineID; |
| | | [SerializeField] Transform transChallengeItemCells; |
| | | [SerializeField] List<ItemCell> challengeItemCells1; |
| | | [SerializeField] List<ItemCell> challengeItemCells2; |
| | | [SerializeField] List<ItemCell> sweepItemCells; |
| | | [SerializeField] List<SkillWordCell> skillWords; |
| | | [SerializeField] ButtonEx btnClose; |
| | | [SerializeField] Transform transNoChallenge; |
| | | [SerializeField] Transform transHasChallenge; |
| | | [SerializeField] BoneFieldChallengeButton btnChallenge1; |
| | | [SerializeField] BoneFieldChallengeButton btnChallenge2; |
| | | [SerializeField] ButtonEx btnSweep; |
| | | [SerializeField] ImageEx imgSweepNo; |
| | | [SerializeField] ButtonEx btnAds; |
| | | [SerializeField] ImageEx imgSweepRed; |
| | | bool isHasNextLineID; |
| | | int adID; |
| | | |
| | | int showSweepMaxCount; |
| | | int showrealRemainSweepCount; |
| | | protected override void InitComponent() |
| | | { |
| | | base.InitComponent(); |
| | | btnClose.SetListener(OnClickClose); |
| | | btnSweep.SetListener(OnClickSweep); |
| | | btnAds.SetListener(OnClickAds); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | base.OnPreOpen(); |
| | | DungeonManager.Instance.UpdateFBInfoChangeEvent += OnUpdateFBInfoChangeEvent; |
| | | AdsManager.Instance.OnAdsInfoListUpdateEvent += OnAdsInfoListUpdateEvent; |
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | base.OnPreClose(); |
| | | DungeonManager.Instance.UpdateFBInfoChangeEvent -= OnUpdateFBInfoChangeEvent; |
| | | AdsManager.Instance.OnAdsInfoListUpdateEvent -= OnAdsInfoListUpdateEvent; |
| | | TimeMgr.Instance.OnDayEvent -= OnDayEvent; |
| | | } |
| | | |
| | | private void OnUpdateFBInfoChangeEvent(int mapID, bool isADAddCntChange, bool isBuyAddCntChange, bool isItemAddCntChange) |
| | | { |
| | | int dataMapID = BoneFieldManager.Instance.DataMapID; |
| | | if (mapID != dataMapID) |
| | | return; |
| | | if (!ADAwardConfig.TryGetADIDByADMapID(BoneFieldManager.Instance.DataMapID, out adID) || !ADAwardConfig.HasKey(adID)) |
| | | return; |
| | | ADAwardConfig aDAwardConfig = ADAwardConfig.Get(adID); |
| | | if (isADAddCntChange) |
| | | { |
| | | DisplayAdsButton(aDAwardConfig); |
| | | } |
| | | else |
| | | { |
| | | Display(); |
| | | } |
| | | } |
| | | |
| | | private void OnAdsInfoListUpdateEvent(int id, int mapId) |
| | | { |
| | | if (mapId != BoneFieldManager.Instance.DataMapID) |
| | | return; |
| | | if (!ADAwardConfig.TryGetADIDByADMapID(BoneFieldManager.Instance.DataMapID, out adID) || !ADAwardConfig.HasKey(adID)) |
| | | return; |
| | | ADAwardConfig aDAwardConfig = ADAwardConfig.Get(adID); |
| | | DisplayAdsButton(aDAwardConfig); |
| | | } |
| | | |
| | | |
| | | private void OnDayEvent() |
| | | { |
| | | Display(); |
| | | } |
| | | |
| | | private void OnClickClose() |
| | | { |
| | | UIManager.Instance.CloseWindow<BoneFieldWin>(); |
| | | } |
| | | |
| | | private void OnClickSweep() |
| | | { |
| | | int dataMapID = BoneFieldManager.Instance.DataMapID; |
| | | if (!DungeonManager.Instance.TryGetFBInfoByMapID(dataMapID, out var fbInfo)) |
| | | return; |
| | | if (!DungeonOpenTimeConfig.HasKey(dataMapID)) |
| | | return; |
| | | DungeonOpenTimeConfig config = DungeonOpenTimeConfig.Get(dataMapID); |
| | | |
| | | if (showrealRemainSweepCount == showSweepMaxCount) |
| | | { |
| | | BoneFieldManager.Instance.SendBBeginFBWipeOut(dataMapID, (int)fbInfo.PassLineID); |
| | | return; |
| | | } |
| | | |
| | | int index = Mathf.Min(Mathf.Max(0, showSweepMaxCount - showrealRemainSweepCount - 1), config.PayMoneyValues.Length - 1); |
| | | int payMoneyValue = config.PayMoneyValues[index]; |
| | | int payMoneyType = config.PayMoneyType; |
| | | ConfirmCancel.MoneyIconToggleConfirmByType(ToggleCheckType.BoneField, payMoneyValue, payMoneyType, |
| | | Language.Get("BoneField11", UIHelper.GetIconNameWithMoneyType(payMoneyType), payMoneyValue), () => |
| | | { |
| | | if (!UIHelper.CheckMoneyCount(payMoneyType, payMoneyValue, 2)) |
| | | return; |
| | | BoneFieldManager.Instance.SendBuyEnterCount(dataMapID); |
| | | BoneFieldManager.Instance.SendBBeginFBWipeOut(dataMapID, (int)fbInfo.PassLineID); |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | private void OnClickAds() |
| | | { |
| | | AdsManager.Instance.PlayAds(adID); |
| | | } |
| | | public void Display() |
| | | { |
| | | int dataMapID = BoneFieldManager.Instance.DataMapID; |
| | | if (!DungeonManager.Instance.TryGetFBInfoByMapID(dataMapID, out var fbInfo)) |
| | | return; |
| | | |
| | | int nowPassLineID = BoneFieldManager.Instance.GetNowPassLineID(fbInfo); |
| | | isHasNextLineID = BoneFieldManager.Instance.IsHasNextLineID(fbInfo); |
| | | DungeonConfig.TryGetDungeonID(dataMapID, nowPassLineID, out int dungeonID); |
| | | if (!DungeonConfig.HasKey(dungeonID)) |
| | | return; |
| | | DungeonConfig dungeonConfig = DungeonConfig.Get(dungeonID); |
| | | int[] lineupIDList = dungeonConfig.LineupIDList; |
| | | if (lineupIDList.IsNullOrEmpty()) |
| | | return; |
| | | int LineupID = lineupIDList[0]; |
| | | if (!NPCLineupConfig.HasKey(LineupID)) |
| | | return; |
| | | NPCLineupConfig lineupConfig = NPCLineupConfig.Get(LineupID); |
| | | int bossId = lineupConfig.BossID; |
| | | if (bossId == 0 || !NPCConfig.HasKey(bossId)) |
| | | return; |
| | | NPCConfig nPCConfig = NPCConfig.Get(bossId); |
| | | if (!ADAwardConfig.TryGetADIDByADMapID(dataMapID, out adID) || !ADAwardConfig.HasKey(adID)) |
| | | return; |
| | | ADAwardConfig aDAwardConfig = ADAwardConfig.Get(adID); |
| | | |
| | | |
| | | DisplayFBInfo(nPCConfig, dungeonConfig, nowPassLineID); |
| | | DisplayChallengeButton(dungeonConfig, fbInfo); |
| | | DisplaySweepButton(dungeonConfig); |
| | | DisplayAdsButton(aDAwardConfig); |
| | | DisplaySkillWordsList(lineupConfig); |
| | | DisplayItemCellList(challengeItemCells1, dungeonConfig.PassAwardList); |
| | | DisplayItemCellList(challengeItemCells2, dungeonConfig.PassAwardList); |
| | | |
| | | if (fbInfo.PassLineID > 0) |
| | | { |
| | | DungeonConfig.TryGetDungeonID(dataMapID, (int)fbInfo.PassLineID, out int sweepDungeonID); |
| | | if (!DungeonConfig.HasKey(dungeonID)) |
| | | return; |
| | | DungeonConfig sweepDungeonConfig = DungeonConfig.Get(sweepDungeonID); |
| | | DisplayItemCellList(sweepItemCells, sweepDungeonConfig.SweepAwardList); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void DisplayFBInfo(NPCConfig nPCConfig, DungeonConfig dungeonConfig, int nowPassLineID) |
| | | { |
| | | imgMaxLineID.SetActive(!isHasNextLineID); |
| | | transChallengeItemCells.SetActive(isHasNextLineID); |
| | | txtBossName.text = nPCConfig.NPCName; |
| | | txtDifficulty.text = nowPassLineID.ToString(); |
| | | txtFightPower.text = UIHelper.ReplaceLargeArtNum(dungeonConfig.FightPower); |
| | | } |
| | | |
| | | public void DisplayChallengeButton(DungeonConfig dungeonConfig, FBInfo fBInfo) |
| | | { |
| | | transNoChallenge.SetActive(fBInfo.PassLineID <= 0); |
| | | transHasChallenge.SetActive(fBInfo.PassLineID > 0); |
| | | btnChallenge1.Display(dungeonConfig.LVLimitMin, isHasNextLineID, dungeonConfig.FightPower); |
| | | btnChallenge2.Display(dungeonConfig.LVLimitMin, isHasNextLineID, dungeonConfig.FightPower); |
| | | } |
| | | |
| | | |
| | | |
| | | public void DisplaySweepButton(DungeonConfig dungeonConfig) |
| | | { |
| | | if (!BoneFieldManager.Instance.TryGetShowSweepCount(out showSweepMaxCount, out showrealRemainSweepCount)) |
| | | return; |
| | | bool isSweepCountOk = showrealRemainSweepCount > 0; |
| | | imgSweepNo.SetActive(!isSweepCountOk); |
| | | btnSweep.interactable = isSweepCountOk; |
| | | long myFightPower = PlayerDatas.Instance.baseData.FightPower; |
| | | imgSweepRed.SetActive(isSweepCountOk && myFightPower < dungeonConfig.FightPower); |
| | | txtFirstFree.SetActive(showSweepMaxCount == showrealRemainSweepCount); |
| | | txtTodaySweepCount.SetActive(showSweepMaxCount > showrealRemainSweepCount); |
| | | txtTodaySweepCount.text = UIHelper.AppendColor(isSweepCountOk ? TextColType.Green : TextColType.Red, Language.Get("BoneField08", showrealRemainSweepCount, showSweepMaxCount)); |
| | | } |
| | | |
| | | public void DisplayAdsButton(ADAwardConfig aDAwardConfig) |
| | | { |
| | | int adsCnt = AdsManager.Instance.GetADCntByADID(adID); |
| | | bool isShowAds = adsCnt < aDAwardConfig.ADCntMax; |
| | | int remainAdsCount = aDAwardConfig.ADCntMax - adsCnt; |
| | | btnAds.SetActive(isShowAds); |
| | | txtTodayAdsCount.text = UIHelper.AppendColor(isShowAds ? TextColType.Green : TextColType.Red, Language.Get("BoneField09", remainAdsCount, aDAwardConfig.ADCntMax)); ; |
| | | } |
| | | |
| | | public void DisplayItemCellList(List<ItemCell> itemCells, int[][] items) |
| | | { |
| | | if (itemCells.IsNullOrEmpty() || items.IsNullOrEmpty()) |
| | | return; |
| | | for (int i = 0; i < itemCells.Count; i++) |
| | | { |
| | | if (i < items.Length) |
| | | { |
| | | int index = i; |
| | | itemCells[i].SetActive(true); |
| | | itemCells[i].Init(new ItemCellModel(items[i][0], true, items[i][1])); |
| | | itemCells[i].button.SetListener(() => |
| | | { |
| | | ItemTipUtility.Show(items[index][0], true); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | itemCells[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void DisplaySkillWordsList(NPCLineupConfig lineUPConfig) |
| | | { |
| | | if (skillWords.IsNullOrEmpty()) |
| | | return; |
| | | for (int i = 0; i < skillWords.Count; i++) |
| | | { |
| | | if (i < lineUPConfig.SkillIDExList.Length) |
| | | { |
| | | skillWords[i].SetActive(true); |
| | | int skillID = lineUPConfig.SkillIDExList[i]; |
| | | skillWords[i].Init(skillID, () => |
| | | { |
| | | SmallTipWin.showText = Language.Get("SmallTipFomat", SkillConfig.Get(skillID)?.SkillName, SkillConfig.Get(skillID)?.Description); |
| | | SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); |
| | | SmallTipWin.isDownShow = true; |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | skillWords[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/System/BoneField/BoneFieldWin.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 018d0a5414867a143940ae53fd9a10c4 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b05faf55c2deb764eaf44f27a0deb3d4 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class ChallengeTabButton : MonoBehaviour |
| | | { |
| | | [SerializeField] Button btnTab; |
| | | [SerializeField] ImageEx imgIcon; |
| | | [SerializeField] TextEx txtName; |
| | | [SerializeField] TextEx txtCount; |
| | | [SerializeField] TextEx txtLockInfo; |
| | | [SerializeField] Transform transUnlock; |
| | | [SerializeField] RedpointBehaviour redpointBehaviour; |
| | | Action action; |
| | | void Awake() |
| | | { |
| | | btnTab.SetListener(() => |
| | | { |
| | | action?.Invoke(); |
| | | }); |
| | | } |
| | | |
| | | public void Display(int index, int redpointId, bool isLock, string countInfo, string lockInfo, Action action) |
| | | { |
| | | redpointBehaviour.redpointId = redpointId; |
| | | transUnlock.SetActive(!isLock); |
| | | txtCount.SetActive(isLock); |
| | | txtLockInfo.SetActive(!isLock); |
| | | imgIcon.SetSprite(StringUtility.Contact("ChallengeTab", index)); |
| | | txtName.text = Language.Get(StringUtility.Contact("ChallengeTab", index)); |
| | | txtCount.text = countInfo; |
| | | txtLockInfo.text = lockInfo; |
| | | this.action = action; |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/System/ChallengeTab/ChallengeTabButton.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 3bb48932e6ad9904b85d4dbab69a6553 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using Cysharp.Threading.Tasks.Triggers; |
| | | using UnityEngine; |
| | | |
| | | public class ChallengeTabWin : UIBase |
| | | { |
| | | [SerializeField] ClickScreenOtherSpace clickScreenOtherSpace; |
| | | [SerializeField] ChallengeTabButton btnBoneField; |
| | | public static Action OnCloseChallengeTabWin; |
| | | protected override void InitComponent() |
| | | { |
| | | base.InitComponent(); |
| | | clickScreenOtherSpace.RemoveAllListeners(); |
| | | clickScreenOtherSpace.AddListener(() => |
| | | { |
| | | UIManager.Instance.CloseWindow<ChallengeTabWin>(); |
| | | }); |
| | | |
| | | } |
| | | protected override void OnPreOpen() |
| | | { |
| | | base.OnPreOpen(); |
| | | DungeonManager.Instance.UpdateFBInfoChangeEvent += OnUpdateFBInfoChangeEvent; |
| | | AdsManager.Instance.OnAdsInfoListUpdateEvent += OnAdsInfoListUpdateEvent; |
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; |
| | | |
| | | Display(); |
| | | } |
| | | |
| | | private void OnDayEvent() |
| | | { |
| | | Display(); |
| | | } |
| | | |
| | | private void OnAdsInfoListUpdateEvent(int id, int mapId) |
| | | { |
| | | Display(); |
| | | } |
| | | |
| | | private void OnUpdateFBInfoChangeEvent(int arg1, bool arg2, bool arg3, bool arg4) |
| | | { |
| | | if (arg1 == BoneFieldManager.Instance.DataMapID) |
| | | { |
| | | DisplayBoneFieldButton(); |
| | | } |
| | | |
| | | } |
| | | public void OnFuncStateChangeEvent(int funcId) |
| | | { |
| | | if (funcId == BoneFieldManager.Instance.funcId) |
| | | { |
| | | DisplayBoneFieldButton(); |
| | | } |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | base.OnPreClose(); |
| | | DungeonManager.Instance.UpdateFBInfoChangeEvent -= OnUpdateFBInfoChangeEvent; |
| | | AdsManager.Instance.OnAdsInfoListUpdateEvent -= OnAdsInfoListUpdateEvent; |
| | | TimeMgr.Instance.OnDayEvent -= OnDayEvent; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent; |
| | | OnCloseChallengeTabWin?.Invoke(); |
| | | } |
| | | public void Display() |
| | | { |
| | | DisplayBoneFieldButton(); |
| | | } |
| | | |
| | | |
| | | public void DisplayBoneFieldButton() |
| | | { |
| | | int index = 2; |
| | | int funcId = BoneFieldManager.Instance.funcId; |
| | | int redpointId = MainRedDot.BoneFieldRepoint; |
| | | bool isLock = FuncOpen.Instance.IsFuncOpen(funcId); |
| | | if (!BoneFieldManager.Instance.TryGetShowSweepCount(out int showSweepMaxCount, out int showrealRemainSweepCount)) |
| | | return; |
| | | string countInfo = UIHelper.AppendColor(showrealRemainSweepCount > 0 ? TextColType.Green : TextColType.Red, Language.Get("Challenge01", showrealRemainSweepCount)); |
| | | string lockInfo = !isLock ? FuncOpen.Instance.GetErrorTip(funcId) : string.Empty; |
| | | btnBoneField.Display(index, redpointId, isLock, countInfo, lockInfo, () => |
| | | { |
| | | if (!FuncOpen.Instance.IsFuncOpen(funcId, true)) |
| | | return; |
| | | UIManager.Instance.OpenWindow<BoneFieldWin>(); |
| | | }); |
| | | } |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta
copy to Main/System/ChallengeTab/ChallengeTabWin.cs.meta
File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA320_tagMCPlayerFBInfoData.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56cd057c8501b0246b3887eaa785e5f4 |
| | | guid: 97c14b01c5b4b344794d9cf10855b050 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | |
|
| | | public int passLineID;
|
| | |
|
| | | public DungeonRecord(HA320_tagMCPlayerFBInfoData.tagMCFBInfo _serverInfo)
|
| | | {
|
| | | this.id = (int)_serverInfo.FBID;
|
| | | this.enterTimes = (int)_serverInfo.EnterCnt;
|
| | | this.recoverTimes = (int)_serverInfo.RecoverCnt;
|
| | | this.extraTimes = (int)_serverInfo.ItemAddCnt;
|
| | | this.lineGrades = new Dictionary<int, int>();
|
| | | this.passLineID = (int)_serverInfo.PassLineID;
|
| | | for (int i = 0; i < _serverInfo.PassGrade.Length; i++)
|
| | | {
|
| | | var tempValue = (int)_serverInfo.PassGrade[i];
|
| | | for (int j = 0; j < 9; j++)
|
| | | {
|
| | | var a = MathUtility.Power(10, j);
|
| | | var b = MathUtility.Power(10, j + 1);
|
| | | this.lineGrades[i * 9 + j] = (tempValue % b) / a;
|
| | | }
|
| | | }
|
| | | this.enterCntTotal = (int)_serverInfo.EnterCntTotal;
|
| | | }
|
| | | // public DungeonRecord(HA320_tagMCPlayerFBInfoData.tagMCFBInfo _serverInfo)
|
| | | // {
|
| | | // this.id = (int)_serverInfo.FBID;
|
| | | // this.enterTimes = (int)_serverInfo.EnterCnt;
|
| | | // this.recoverTimes = (int)_serverInfo.RecoverCnt;
|
| | | // this.extraTimes = (int)_serverInfo.ItemAddCnt;
|
| | | // this.lineGrades = new Dictionary<int, int>();
|
| | | // this.passLineID = (int)_serverInfo.PassLineID;
|
| | | // for (int i = 0; i < _serverInfo.PassGrade.Length; i++)
|
| | | // {
|
| | | // var tempValue = (int)_serverInfo.PassGrade[i];
|
| | | // for (int j = 0; j < 9; j++)
|
| | | // {
|
| | | // var a = MathUtility.Power(10, j);
|
| | | // var b = MathUtility.Power(10, j + 1);
|
| | | // this.lineGrades[i * 9 + j] = (tempValue % b) / a;
|
| | | // }
|
| | | // }
|
| | | // this.enterCntTotal = (int)_serverInfo.EnterCntTotal;
|
| | | // }
|
| | |
|
| | | public DungeonRecord(HA3BD_tagMCBuyEnterInfo.tagMCBuyInfo _serverInfo)
|
| | | {
|
| | |
| | | this.buyTimes = _serverInfo.BuyCount;
|
| | | }
|
| | |
|
| | | public void UpdateRecord(HA320_tagMCPlayerFBInfoData.tagMCFBInfo _serverInfo)
|
| | | {
|
| | | this.enterTimes = (int)_serverInfo.EnterCnt;
|
| | | this.recoverTimes = (int)_serverInfo.RecoverCnt;
|
| | | this.extraTimes = (int)_serverInfo.ItemAddCnt;
|
| | | this.passLineID = (int)_serverInfo.PassLineID;
|
| | | for (int i = 0; i < _serverInfo.PassGrade.Length; i++)
|
| | | {
|
| | | var tempValue = (int)_serverInfo.PassGrade[i];
|
| | | for (int j = 0; j < 9; j++)
|
| | | {
|
| | | var a = MathUtility.Power(10, j);
|
| | | var b = MathUtility.Power(10, j + 1);
|
| | | this.lineGrades[i * 9 + j] = (tempValue % b) / a;
|
| | | }
|
| | | }
|
| | | this.enterCntTotal = (int)_serverInfo.EnterCntTotal;
|
| | | }
|
| | | // public void UpdateRecord(HA320_tagMCPlayerFBInfoData.tagMCFBInfo _serverInfo)
|
| | | // {
|
| | | // this.enterTimes = (int)_serverInfo.EnterCnt;
|
| | | // this.recoverTimes = (int)_serverInfo.RecoverCnt;
|
| | | // this.extraTimes = (int)_serverInfo.ItemAddCnt;
|
| | | // this.passLineID = (int)_serverInfo.PassLineID;
|
| | | // for (int i = 0; i < _serverInfo.PassGrade.Length; i++)
|
| | | // {
|
| | | // var tempValue = (int)_serverInfo.PassGrade[i];
|
| | | // for (int j = 0; j < 9; j++)
|
| | | // {
|
| | | // var a = MathUtility.Power(10, j);
|
| | | // var b = MathUtility.Power(10, j + 1);
|
| | | // this.lineGrades[i * 9 + j] = (tempValue % b) / a;
|
| | | // }
|
| | | // }
|
| | | // this.enterCntTotal = (int)_serverInfo.EnterCntTotal;
|
| | | // }
|
| | |
|
| | | public void UpdateRecord(HA3BD_tagMCBuyEnterInfo.tagMCBuyInfo _serverInfo)
|
| | | {
|
New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System; |
| | | using LitJson; |
| | | |
| | | |
| | | public class DungeonManager : GameSystemManager<DungeonManager> |
| | | { |
| | | private Dictionary<int, FBInfo> fbInfoDict = new Dictionary<int, FBInfo>(); |
| | | public event Action<int> UpdateFBInfoListEvent;//int mapID |
| | | public event Action<int, bool, bool, bool> UpdateFBInfoChangeEvent; |
| | | public event Action<int> UpdateFBInfoListEventByADAddCnt;//int mapID 广告增加次数有更新 |
| | | public event Action<int> UpdateFBInfoListEventNotByADAddCnt;//int mapID 不是广告增加次数导致的更新 |
| | | Dictionary<int, DungeonRecord> dungeonRecords = new Dictionary<int, DungeonRecord>(); |
| | | public event Action updateDungeonBuyCnt; |
| | | |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitializeEvent; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitializeEvent; |
| | | } |
| | | |
| | | public void OnBeforePlayerDataInitializeEvent() |
| | | { |
| | | fbInfoDict.Clear(); |
| | | } |
| | | |
| | | public bool TryGetFBInfoByMapID(int mapID, out FBInfo info) |
| | | { |
| | | return fbInfoDict.TryGetValue(mapID, out info); |
| | | } |
| | | |
| | | public void UpdateFBInfoList(HA320_tagSCFBInfoList vNetData) |
| | | { |
| | | if (vNetData == null || vNetData.FBDataList.IsNullOrEmpty()) |
| | | return; |
| | | bool isADAddCntChange = false; |
| | | bool isBuyAddCntChange = false; |
| | | bool isItemAddCntChange = false; |
| | | |
| | | foreach (var item in vNetData.FBDataList) |
| | | { |
| | | if (!fbInfoDict.ContainsKey((int)item.MapID)) |
| | | fbInfoDict[(int)item.MapID] = new FBInfo(); |
| | | int mapID = (int)item.MapID; |
| | | fbInfoDict[mapID].MapID = item.MapID; |
| | | fbInfoDict[mapID].EnterCnt = item.EnterCnt; |
| | | |
| | | isADAddCntChange = fbInfoDict[mapID].ADAddCnt != item.ADAddCnt; |
| | | fbInfoDict[mapID].ADAddCnt = item.ADAddCnt; |
| | | |
| | | isBuyAddCntChange = fbInfoDict[mapID].BuyAddCnt != item.BuyAddCnt; |
| | | fbInfoDict[mapID].BuyAddCnt = item.BuyAddCnt; |
| | | |
| | | isItemAddCntChange = fbInfoDict[mapID].ItemAddCnt != item.ItemAddCnt; |
| | | fbInfoDict[mapID].ItemAddCnt = item.ItemAddCnt; |
| | | |
| | | fbInfoDict[mapID].PassLineID = item.PassLineID; |
| | | fbInfoDict[mapID].PassGradeCnt = item.PassGradeCnt; |
| | | fbInfoDict[mapID].PassGrade = item.PassGrade; |
| | | |
| | | UpdateFBInfoListEvent?.Invoke(mapID); |
| | | UpdateFBInfoChangeEvent?.Invoke(mapID, isADAddCntChange, isBuyAddCntChange, isItemAddCntChange); |
| | | } |
| | | } |
| | | |
| | | public void UpdateRecords(HA3BD_tagMCBuyEnterInfo.tagMCBuyInfo[] vNetDatas) |
| | | { |
| | | for (int i = 0; i < vNetDatas.Length; i++) |
| | | { |
| | | var info = vNetDatas[i]; |
| | | var dungeonId = (int)info.FBID; |
| | | if (dungeonRecords.ContainsKey(dungeonId)) |
| | | { |
| | | dungeonRecords[dungeonId].UpdateRecord(info); |
| | | } |
| | | else |
| | | { |
| | | dungeonRecords[dungeonId] = new DungeonRecord(info); |
| | | } |
| | | } |
| | | if (updateDungeonBuyCnt != null) |
| | | { |
| | | updateDungeonBuyCnt(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | public class FBInfo |
| | | { |
| | | public uint MapID; |
| | | public ushort EnterCnt; //今日累计进入次数 |
| | | public byte ADAddCnt; //广告增加次数 |
| | | public byte BuyAddCnt; //购买增加次数 |
| | | public ushort ItemAddCnt; //物品增加次数 |
| | | public uint PassLineID; //已过关到的lineID |
| | | public byte PassGradeCnt; //星级值对应个数, 每个key存9个lineID |
| | | public uint[] PassGrade; //副本线路对应星级值列表 |
| | | } |
| | | |
| | |
| | |
|
| | |
|
| | |
|
| | | protected override void OnPreClose()
|
| | | protected override void OnClose()
|
| | | {
|
| | | EquipModel.Instance.OnEquipOPResultAction -= OnRefreshItem;
|
| | | // 通知主战场
|
| | |
| | | if (waitEquipOP.Count == 0) |
| | | return null; |
| | | |
| | | return PackManager.Instance.GetItemByIndex(PackType.DropItem, waitEquipOP.Dequeue()); |
| | | // 新手引导中,不允许切换装备界面 |
| | | if (NewBieCenter.Instance.inGuiding) |
| | | return null; |
| | | |
| | | return PackManager.Instance.GetItemByIndex(PackType.DropItem, waitEquipOP.Dequeue()); |
| | | } |
| | | |
| | | |
| | |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | RechargeManager.Instance.rechargeCountEvent += OnRechargeCountEvent; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; |
| | | |
| | | InitClickTabDict(); |
| | | InitRedPoint(); |
| | | } |
| | | |
| | | public override void Release() |
| | |
| | | { |
| | | firstChargeInfoDict.Clear(); |
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | InitClickTabDict(); |
| | | InitRedPoint(); |
| | | if (FuncOpen.Instance.IsFuncOpen(FuncID)&& TryGetUnBuyFirstId(out int firstId)) |
| | | if (FuncOpen.Instance.IsFuncOpen(FuncID) && TryGetUnBuyFirstId(out int firstId)) |
| | | { |
| | | PopupWindowsProcessor.Instance.Add("FirstChargeWin"); |
| | | } |
| | | } |
| | | |
| | | public bool TryGetFirstChargeDataByFirstId(int firstId, out FirstChargeData firstChargeData) |
| | | { |
| | | return firstChargeInfoDict.TryGetValue(firstId, out firstChargeData); |
| | |
| | | UpdateRedPoint(); |
| | | OnUpdateFirstChargeInfo?.Invoke(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 检查是否所有首充奖励都已领取,如果是,则将当前服务器时间保存到本地 |
| | | /// </summary> |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // 检查是否所有首充奖励都已经领取 |
| | | public bool IsAllFirstChargeRewardsClaimed() |
| | | { |
| | |
| | | var firstChargeIds = FirstChargeConfig.GetKeys(); |
| | | if (firstChargeIds == null || firstChargeIds.Count == 0) |
| | | return false; |
| | | |
| | | |
| | | foreach (var firstId in firstChargeIds) |
| | | { |
| | | // 尝试获取首充数据 |
| | | if (!TryGetFirstChargeDataByFirstId(firstId, out var firstChargeData)) |
| | | return false; |
| | | |
| | | |
| | | // 检查是否购买 |
| | | if (!firstChargeData.IsBuy()) |
| | | return false; |
| | | |
| | | |
| | | // 检查是否所有奖励都已领取 |
| | | if (!firstChargeData.IsAllHave()) |
| | | return false; |
| | |
| | | // 检查是否已经过了第二天0点 |
| | | return true; |
| | | } |
| | | |
| | | |
| | | // 检查是否已经过了所有奖励领取完毕后的第二天0点 |
| | | public bool IsNextDayAfterAllClaimed() |
| | | { |
| | | // 生成一个唯一的键来获取时间 |
| | | string key = $"FirstCharge_AllRewardsClaimed_Time_{PlayerDatas.Instance.baseData.PlayerID}"; |
| | | |
| | | |
| | | // 检查是否存在记录的时间戳 |
| | | if (!LocalSave.HasKey(key)) |
| | | return false; |
| | | |
| | | |
| | | // 获取记录的时间戳 |
| | | string timeString = LocalSave.GetString(key); |
| | | if (string.IsNullOrEmpty(timeString)) |
| | | return false; |
| | | |
| | | |
| | | // 解析时间戳 |
| | | if (!long.TryParse(timeString, out long ticks)) |
| | | return false; |
| | | |
| | | |
| | | // 将时间戳转换为DateTime |
| | | DateTime allRewardsClaimedTime = new DateTime(ticks); |
| | | |
| | | |
| | | // 计算第二天0点的时间 |
| | | DateTime nextDayStart = allRewardsClaimedTime.Date.AddDays(1); |
| | | |
| | | |
| | | // 判断当前服务器时间是否已经过了第二天0点 |
| | | DateTime serverNow = TimeUtility.ServerNow; |
| | | return serverNow >= nextDayStart; |
| | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | // ... existing code ... |
| | | |
| | | // ... existing code ... |
| | | /// <summary> |
| | | /// 获取当前时间是购买这档充值礼包的第几天 |
| | | /// 购买的当天算作第一天,第二天0点后算第二天,以此类推 |
| | |
| | | { |
| | | DateTime serverNow = TimeUtility.ServerNow; |
| | | DateTime chargeTime = TimeUtility.GetTime(ChargeTime); |
| | | |
| | | |
| | | DateTime chargeDate = chargeTime.Date; |
| | | DateTime serverDate = serverNow.Date; |
| | | |
| | | |
| | | // 计算从充值日期到当前日期的完整天数 |
| | | // 购买的当天算第一天,第二天0点后算第二天 |
| | | TimeSpan timeSpan = serverDate - chargeDate; |
| | | int days = (int)timeSpan.TotalDays + 1; // +1 因为当天算第一天 |
| | | |
| | | |
| | | int maxDay = FirstChargeManager.Instance.maxDay; |
| | | |
| | | return Mathf.Min(maxDay, Mathf.Max(1, days)); |
| | |
| | | public readonly string dateFormat = "yyyy.MM.dd"; |
| | | public string nowUuid = string.Empty; |
| | | public int personalMailMaxLimitCount; |
| | | |
| | | |
| | | public override void Init() |
| | | { |
| | | if (tabRedpoint0 == null) |
| | | { |
| | | tabRedpoint0 = new Redpoint(MainRedDot.MailRepoint, GetTabRedpointId(MailCategory.Personal)); |
| | | } |
| | | if (tabRedpoint1 == null) |
| | | { |
| | | tabRedpoint1 = new Redpoint(MainRedDot.MailRepoint, GetTabRedpointId(MailCategory.Global)); |
| | | } |
| | | tabRedpoint0 = new Redpoint(MainRedDot.MailRepoint, GetTabRedpointId(MailCategory.Personal)); |
| | | tabRedpoint1 = new Redpoint(MainRedDot.MailRepoint, GetTabRedpointId(MailCategory.Global)); |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitializeEvent; |
| | | personalMailMaxLimitCount = int.Parse(FuncConfigConfig.Get("PersonalMail").Numerical1); |
| | | } |
| | |
| | | { |
| | | // 小于1天(但未过期):按精确的小时/分钟显示。 |
| | | TimeSpan t = TimeSpan.FromDays(days); |
| | | result = Language.Get("Mail12",StringUtility.Contact( " ", Language.Get("Mail13", t.Hours, t.Minutes))); |
| | | result = Language.Get("Mail12", StringUtility.Contact(" ", Language.Get("Mail13", t.Hours, t.Minutes))); |
| | | } |
| | | else |
| | | { |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | |
| | | { |
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh; |
| | | AutoFightModel.Instance.OnFightEvent += OnSkillCast; |
| | | ChallengeTabWin.OnCloseChallengeTabWin += OnCloseChallengeTabWin; |
| | | base.OnPreOpen(); |
| | | |
| | | // 刷新UI |
| | |
| | | { |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh; |
| | | AutoFightModel.Instance.OnFightEvent -= OnSkillCast; |
| | | ChallengeTabWin.OnCloseChallengeTabWin -= OnCloseChallengeTabWin; |
| | | base.OnPreClose(); |
| | | } |
| | | |
| | | private void OnCloseChallengeTabWin() |
| | | { |
| | | tabButtons[3].state = TitleBtnState.Normal; |
| | | tabButtons[3].UpdateButtonState(); |
| | | } |
| | | |
| | | protected override void SelectBottomTab(int index) |
| | | { |
| | | if (index == 3) |
| | | { |
| | | //挑战特殊显示逻辑 |
| | | UIManager.Instance.OpenWindow<ChallengeTabWin>(); |
| | | return; |
| | | } |
| | | |
| | |
| | | List<int> allGuides = new List<int>();
|
| | | public List<int> completeGuidesBuf = new List<int>();
|
| | |
|
| | | //因其他原因导致的等待显示的引导窗口,在OpenWindow时会触发复查,但时机太晚增加关闭界面时触发
|
| | | List<string> waitGuideWinNames = new List<string>(); |
| | |
|
| | | bool inited = false;
|
| | |
|
| | | public event Action guideStepChangeEvent;
|
| | | public event Action guideBeginEvent;
|
| | | public event Action<int> guideCompletedEvent;
|
| | | |
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
|
| | | UIManager.Instance.OnOpenWindow += OnOpenWindow;
|
| | | UIManager.Instance.OnCloseWindow += OnCloseWindow;
|
| | | }
|
| | |
|
| | | public override void Release()
|
| | |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
|
| | | UIManager.Instance.OnOpenWindow -= OnOpenWindow;
|
| | | UIManager.Instance.OnCloseWindow -= OnCloseWindow;
|
| | | }
|
| | |
|
| | | void OnOpenWindow(UIBase _ui)
|
| | |
| | | if (guides != null)
|
| | | {
|
| | | TryStartNewBieGuides(guides);
|
| | | }
|
| | | }
|
| | |
|
| | | //关闭其他界面时复查有没需要等待的引导
|
| | | void OnCloseWindow(UIBase _ui)
|
| | | {
|
| | | foreach (var winName in waitGuideWinNames)
|
| | | {
|
| | | var guides = GuideConfig.GetGuideListByWinName(winName);
|
| | | if (guides != null)
|
| | | {
|
| | | if (TryStartNewBieGuides(guides))
|
| | | {
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var guides = GuideConfig.GetGuideListByType((int)GuideTriggerType.MissionClick);
|
| | | if (guides != null)
|
| | | {
|
| | | TryStartNewBieGuides(guides);
|
| | | TryStartNewBieGuides(guides, true);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | //找出可进行的引导
|
| | | public void TryStartNewBieGuides(List<int> _guides)
|
| | | //isOrgTrigger 是否是原生触发,如点击的只能是原生触发,其他的都不能
|
| | | public bool TryStartNewBieGuides(List<int> _guides, bool isOrgTrigger = false)
|
| | | {
|
| | | if (!inited)
|
| | | {
|
| | |
| | |
|
| | | if (_guides == null)
|
| | | {
|
| | | return;
|
| | | return false;
|
| | | }
|
| | |
|
| | | if (currentGuide != 0)
|
| | | {
|
| | | return;
|
| | | return false;
|
| | | }
|
| | |
|
| | | var ok = false;
|
| | | for (int i = 0; i < _guides.Count; i++)
|
| | | {
|
| | | var guideId = _guides[i];
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | ok = CheckGuideCondition(guideId);
|
| | | if (ok && currentGuide != guideId)
|
| | | if (currentGuide != guideId && CheckGuideCondition(guideId, isOrgTrigger))
|
| | | {
|
| | | StartNewBieGuide(guideId);
|
| | | break;
|
| | | return StartNewBieGuide(guideId);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | | public void StartNewBieGuide(int _id)
|
| | | bool WaitGuide(int _id)
|
| | | {
|
| | | var config = GuideConfig.Get(_id);
|
| | | if (UIManager.Instance.ExistAnyFullScreenOrMaskWin(config.WinName))
|
| | | {
|
| | | if (!waitGuideWinNames.Contains(config.WinName))
|
| | | {
|
| | | waitGuideWinNames.Add(config.WinName);
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | |
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool StartNewBieGuide(int _id)
|
| | | {
|
| | | if (_id == 0)
|
| | | {
|
| | | Debug.LogError("请检查引导id = 0 的情况");
|
| | | return;
|
| | | return false;
|
| | | }
|
| | |
|
| | | var config = GuideConfig.Get(_id);
|
| | | if (config == null)
|
| | | {
|
| | | Debug.LogError($"没有该引导ID,请检查引导id = {_id} 的情况");
|
| | | return;
|
| | | return false;
|
| | | }
|
| | |
|
| | | AutoFightModel.Instance.isPause = true;
|
| | | if (WaitGuide(_id))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (waitGuideWinNames.Contains(config.WinName))
|
| | | {
|
| | | waitGuideWinNames.Remove(config.WinName);
|
| | | }
|
| | |
|
| | | BattleManager.Instance.storyBattleField.IsPause = true;
|
| | | currentGuide = _id;
|
| | |
|
| | | guideStep = config.Steps.Length > 0 ? config.Steps[0] : 0;
|
| | |
| | | guideStepChangeEvent?.Invoke();
|
| | | }
|
| | | UIManager.Instance.CloseWindow<ChatWin>();
|
| | | return true;
|
| | |
|
| | | }
|
| | |
|
| | | bool IsNeedRecord(int _id)
|
| | | {
|
| | | return GuideConfig.Get(_id).NoRecord == 0;
|
| | | }
|
| | |
|
| | | public void FinishNewBieGuide(int _id)
|
| | |
| | | currentGuide = 0;
|
| | |
|
| | | UIManager.Instance.CloseWindow<NewBieWin>();
|
| | | if (!completeGuidesBuf.Contains(guideRecord))
|
| | | if (IsNeedRecord(_id))
|
| | | {
|
| | | completeGuidesBuf.Add(guideRecord);
|
| | | }
|
| | | if (!completeGuidesBuf.Contains(guideRecord))
|
| | | {
|
| | | completeGuidesBuf.Add(guideRecord);
|
| | | }
|
| | |
|
| | | var send = new CA222_tagCMSetGuideOK();
|
| | | send.GuideIndex = (byte)_id;
|
| | | send.IsOK = 1;
|
| | | GameNetSystem.Instance.SendInfo(send);
|
| | | var send = new CA222_tagCMSetGuideOK();
|
| | | send.GuideIndex = (byte)_id;
|
| | | send.IsOK = 1;
|
| | | GameNetSystem.Instance.SendInfo(send);
|
| | | }
|
| | |
|
| | | if (guideCompletedEvent != null)
|
| | | {
|
| | | guideCompletedEvent(guideRecord);
|
| | | }
|
| | |
|
| | | AutoFightModel.Instance.isPause = false;
|
| | | BattleManager.Instance.storyBattleField.IsPause = false;
|
| | | }
|
| | |
|
| | | public void RemoveNewBieGuide(int _id)
|
| | | {
|
| | | if (!completeGuidesBuf.Contains(_id))
|
| | | if (IsNeedRecord(_id))
|
| | | {
|
| | | completeGuidesBuf.Add(_id);
|
| | | }
|
| | | if (!completeGuidesBuf.Contains(_id))
|
| | | {
|
| | | completeGuidesBuf.Add(_id);
|
| | | }
|
| | |
|
| | | var send = new CA222_tagCMSetGuideOK();
|
| | | send.GuideIndex = (byte)_id;
|
| | | send.IsOK = 1;
|
| | | GameNetSystem.Instance.SendInfo(send);
|
| | | var send = new CA222_tagCMSetGuideOK();
|
| | | send.GuideIndex = (byte)_id;
|
| | | send.IsOK = 1;
|
| | | GameNetSystem.Instance.SendInfo(send);
|
| | | }
|
| | | }
|
| | |
|
| | | public void FinishCurrentGuideWithoutCloseWin()
|
| | | {
|
| | | var guideRecord = currentGuide;
|
| | | currentGuide = 0;
|
| | | completeGuidesBuf.Add(guideRecord);
|
| | |
|
| | | var send = new CA222_tagCMSetGuideOK();
|
| | | send.GuideIndex = (byte)guideRecord;
|
| | | send.IsOK = 1;
|
| | | GameNetSystem.Instance.SendInfo(send);
|
| | | if (IsNeedRecord(guideRecord))
|
| | | {
|
| | | if (!completeGuidesBuf.Contains(guideRecord))
|
| | | {
|
| | | completeGuidesBuf.Add(guideRecord);
|
| | | }
|
| | |
|
| | | var send = new CA222_tagCMSetGuideOK();
|
| | | send.GuideIndex = (byte)guideRecord;
|
| | | send.IsOK = 1;
|
| | | GameNetSystem.Instance.SendInfo(send);
|
| | | }
|
| | |
|
| | | if (guideCompletedEvent != null)
|
| | | {
|
| | | guideCompletedEvent(guideRecord);
|
| | | }
|
| | |
|
| | | AutoFightModel.Instance.isPause = false;
|
| | | BattleManager.Instance.storyBattleField.IsPause = false;
|
| | | }
|
| | |
|
| | | public void ReportGuideStepComplete(int _step)
|
| | |
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public bool CheckGuideCondition(int _guideId)
|
| | | //isOrgTrigger 是否是原生触发,如点击的只能是原生触发,其他的都不能
|
| | | public bool CheckGuideCondition(int _guideId, bool isOrgTrigger)
|
| | | {
|
| | | var config = GuideConfig.Get(_guideId);
|
| | | if (config == null)
|
| | |
| | | return false;
|
| | | }
|
| | | if (!UIManager.Instance.IsOpened(config.WinName))
|
| | | { |
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | switch ((GuideTriggerType)config.TriggerType)
|
| | | {
|
| | | case GuideTriggerType.None:
|
| | | return true;
|
| | | case GuideTriggerType.FunctionOpen:
|
| | | return FuncOpen.Instance.IsFuncOpen(config.Condition);
|
| | | case GuideTriggerType.Level:
|
| | | return PlayerDatas.Instance.baseData.LV >= config.Condition;
|
| | | case GuideTriggerType.OpenWindow:
|
| | | return UIManager.Instance.IsOpened(config.WinName);
|
| | | case GuideTriggerType.MainLineQuestCanDo:
|
| | | if (config.SupplementCondition == 2)
|
| | | {
|
| | | return TaskManager.Instance.mainTask.TaskID == config.Condition && TaskManager.Instance.GetMainTaskState() == 2;
|
| | | }
|
| | | return TaskManager.Instance.mainTask.TaskID == config.Condition;
|
| | | case GuideTriggerType.Map:
|
| | | return PlayerDatas.Instance.baseData.ExAttr1 >= config.Condition;
|
| | | case GuideTriggerType.MissionClick:
|
| | | return TaskManager.Instance.GetMainTaskType() == config.Condition;
|
| | | default:
|
| | | return false;
|
| | | }
|
| | | {
|
| | | case GuideTriggerType.None:
|
| | | return true;
|
| | | case GuideTriggerType.FunctionOpen:
|
| | | return FuncOpen.Instance.IsFuncOpen(config.Condition);
|
| | | case GuideTriggerType.Level:
|
| | | return PlayerDatas.Instance.baseData.LV >= config.Condition;
|
| | | case GuideTriggerType.OpenWindow:
|
| | | return UIManager.Instance.IsOpened(config.WinName);
|
| | | case GuideTriggerType.MainLineQuestCanDo:
|
| | | if (config.SupplementCondition == 2)
|
| | | {
|
| | | return TaskManager.Instance.mainTask.TaskID == config.Condition && TaskManager.Instance.GetMainTaskState() == 2;
|
| | | }
|
| | | return TaskManager.Instance.mainTask.TaskID == config.Condition;
|
| | | case GuideTriggerType.Map:
|
| | | return PlayerDatas.Instance.baseData.ExAttr1 >= config.Condition;
|
| | | case GuideTriggerType.MissionClick:
|
| | | //只有真正点击才可以触发
|
| | | if (isOrgTrigger)
|
| | | {
|
| | | return TaskManager.Instance.GetMainTaskType() == config.Condition && TaskManager.Instance.GetMainTaskState() != 2;
|
| | | }
|
| | | return false;
|
| | | default:
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public void CompleteAllGuides()
|
| | | {
|
| | |
| | | currentGuide = 0;
|
| | | UIManager.Instance.CloseWindow<NewBieWin>();
|
| | |
|
| | | completeGuidesBuf.Clear();
|
| | | var allGuideKeys = GuideConfig.GetKeys();
|
| | | for (int i = 0; i < allGuideKeys.Count; i++)
|
| | | {
|
| | | completeGuidesBuf.Add(allGuideKeys[i]);
|
| | | if (IsNeedRecord(allGuideKeys[i]))
|
| | | {
|
| | | completeGuidesBuf.Add(allGuideKeys[i]);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | NewBieCenter.Instance.guideStepChangeEvent += OnStepChange;
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | protected override void OnClose()
|
| | | {
|
| | | NewBieCenter.Instance.guideStepChangeEvent -= OnStepChange;
|
| | | if (NewBieCenter.Instance.currentGuide != 0)
|
| | |
| | | {
|
| | | m_ClickTarget = FindTransform(stepConfig.UIElementPath);
|
| | | if (m_ClickTarget != null)
|
| | | { |
| | | {
|
| | | m_lastTargetPosition = m_ClickTarget.position;
|
| | | }
|
| | | else
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | if (!string.IsNullOrEmpty(stepConfig.UIElementPath))
|
| | | Debug.LogError($"引导步骤{step}找不到目标{stepConfig.UIElementPath}, 若不需要请删除路径");
|
| | | #endif
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | |
| | | {
|
| | | if (Input.GetMouseButtonUp(0))
|
| | | {
|
| | | if (stepConfig == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (stepConfig.clickAnyWhereComplete || m_NewBieMask.mask.IsInCirleArea(Input.mousePosition, CameraManager.uiCamera))
|
| | | {
|
| | | if (m_ClickTarget == null)
|
| | |
| | | public const int FairySiegeRepoint = 466; //仙盟攻城战
|
| | | public const int MailRepoint = 467; //邮箱
|
| | | public const int FirstChargeRepoint = 468; //首充
|
| | |
|
| | | public const int BoneFieldRepoint = 469; //白骨盈野
|
| | |
|
| | |
|
| | | public void Register()
|
| | |
| | | Auction = 0, //拍卖行 |
| | | WashCancel = 1, //洗练取消 |
| | | GoldRush = 2, //淘金 |
| | | BoneField = 3, //白骨盈野 |
| | | } |
| | | |
| | | |