130 子 【战斗】战斗系统 / 【战斗】战斗系统-客户端 飘血 配置优化
| | |
| | |
|
| | | private static List<string> ExcludeClassList = new List<string>()
|
| | | {
|
| | | // 特殊表格
|
| | | "InitialFunctionConfig",
|
| | | "PriorLanguageConfig",
|
| | |
|
| | | // 正常读取小于5ms的表 使用lazyload
|
| | | "AppointItemConfig",
|
| | | "AudioConfig",
|
| | | "ChatBubbleBoxConfig",
|
| | | "ChestsConfig",
|
| | | "CTGSelectItemConfig",
|
| | | "DailyLivenessRewardConfig",
|
| | | "DailyQuestConfig",
|
| | | "DailyQuestOpenTimeConfig",
|
| | | "DienstgradConfig",
|
| | | "DirtyNameConfig",
|
| | | "EffectConfig",
|
| | | "EmojiPackConfig",
|
| | | "EquipPlaceMapConfig",
|
| | | "FamilyConfig",
|
| | | "FamilyEmblemConfig",
|
| | | "FirstGoldConfig",
|
| | | "FrameAnimationConfig",
|
| | | "FuncConfigConfig",
|
| | | "FuncOpenLVConfig",
|
| | | "FunctionTeamSetConfig",
|
| | | "GetItemWaysConfig",
|
| | | "GmCmdConfig",
|
| | | "GuideConfig",
|
| | | "HeroAwakeConfig",
|
| | | "HeroBreakConfig",
|
| | | "HeroConfig",
|
| | | "HeroFetterConfig",
|
| | | "HeroQualityAwakeConfig",
|
| | | "HeroQualityBreakConfig",
|
| | | "HeroQualityConfig",
|
| | | "HeroSkinConfig",
|
| | | "HeroTalentConfig",
|
| | | "IconConfig",
|
| | | "ItemConfig",
|
| | | "KickOutReasonConfig",
|
| | | "LanguageConfig",
|
| | | "MailConfig",
|
| | | "PlayerFaceConfig",
|
| | | "PlayerFacePicConfig",
|
| | | "PlayerPropertyConfig",
|
| | | "priorbundleConfig",
|
| | | "RealmConfig",
|
| | | "RealmLVUPTaskConfig",
|
| | | "RichTextMsgReplaceConfig",
|
| | | "RuleConfig",
|
| | | "SkillConfig",
|
| | | "TaskConfig",
|
| | | "TreasureCntAwardConfig",
|
| | | };
|
| | |
|
| | | [MenuItem("Tools/手动刷新")]
|
| | |
| | | }
|
| | | sb.AppendLine(" };");
|
| | | sb.AppendLine();
|
| | | sb.AppendLine("#if UNITY_EDITOR");
|
| | | sb.AppendLine(" List<string> fastName = new List<string>();");
|
| | | sb.AppendLine("#endif");
|
| | |
|
| | |
|
| | | sb.AppendLine(" // 逐个加载配置并更新进度");
|
| | | sb.AppendLine(" for (int i = 0; i < configTypes.Length; i++)");
|
| | | sb.AppendLine(" {");
|
| | | sb.AppendLine(" var sw = System.Diagnostics.Stopwatch.StartNew();");
|
| | | sb.AppendLine(" await LoadConfigByType(configTypes[i]);");
|
| | | sb.AppendLine(" sw.Stop();");
|
| | | sb.AppendLine("#if UNITY_EDITOR");
|
| | | sb.AppendLine(" if (sw.ElapsedMilliseconds >= 100)");
|
| | | sb.AppendLine(" {");
|
| | | sb.AppendLine(" Debug.LogError($\"加载配置 {configTypes[i].Name} 耗时较长: {sw.ElapsedMilliseconds} ms\");");
|
| | | sb.AppendLine(" }");
|
| | | sb.AppendLine(" else if (sw.ElapsedMilliseconds <= 5)");
|
| | | sb.AppendLine(" {");
|
| | | sb.AppendLine(" fastName.Add(configTypes[i].Name);");
|
| | | sb.AppendLine(" }");
|
| | | sb.AppendLine(" Debug.Log($\"加载配置: {configTypes[i].Name} 用时: {sw.ElapsedMilliseconds} ms\");");
|
| | | sb.AppendLine("#endif");
|
| | | sb.AppendLine(" loadingProgress = (float)(i + 1) / totalConfigs;");
|
| | | sb.AppendLine(" }");
|
| | | }
|
| | |
| | | Debug.LogError("没有找到配置类 : " + configClasses.Count);
|
| | | }
|
| | |
|
| | | sb.AppendLine("#if UNITY_EDITOR");
|
| | | sb.AppendLine(" System.IO.File.WriteAllText(Application.dataPath + \"/fastConfig.txt\", string.Join(\"\\n\", fastName));");
|
| | | sb.AppendLine("#endif");
|
| | | sb.AppendLine();
|
| | | sb.AppendLine(" // 加载完成后设置isLoadFinished为true");
|
| | | sb.AppendLine(" loadingProgress = 1f;");
|
| | |
| | | sb.AppendLine(" {");
|
| | | sb.AppendLine(" configName = configName.Substring(0, configName.Length - 6);");
|
| | | sb.AppendLine(" }");
|
| | | sb.AppendLine(" TextAsset textAsset = ResManager.Instance.LoadAsset<TextAsset>(\"Config\", configName);");
|
| | | sb.AppendLine(" if (textAsset != null)");
|
| | | sb.AppendLine(" string[] texts = ResManager.Instance.LoadConfig(configName);");
|
| | | sb.AppendLine(" if (texts != null)");
|
| | | sb.AppendLine(" {");
|
| | | sb.AppendLine(" string[] lines = textAsset.text.Split('\\n');");
|
| | | sb.AppendLine(" string[] lines = texts;");
|
| | | sb.AppendLine(" var methodInfo = configType.GetMethod(\"Init\", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);");
|
| | | sb.AppendLine(" if (methodInfo != null)");
|
| | | sb.AppendLine(" {");
|
| | |
| | | sb.AppendLine(" {");
|
| | | sb.AppendLine(" string configName = typeof(T).Name;");
|
| | | sb.AppendLine();
|
| | | sb.AppendLine(" TextAsset textAsset = ResManager.Instance.LoadAsset<TextAsset>(\"Config\", configName);");
|
| | | sb.AppendLine(" if (textAsset != null)");
|
| | | sb.AppendLine(" string[] texts = ResManager.Instance.LoadConfig(configName);");
|
| | | sb.AppendLine(" if (texts != null)");
|
| | | sb.AppendLine(" {");
|
| | | sb.AppendLine(" string[] lines = textAsset.text.Split('\\n');");
|
| | | sb.AppendLine(" string[] lines = texts;");
|
| | | sb.AppendLine(" var methodInfo = typeof(T).GetMethod(\"Init\", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);");
|
| | | sb.AppendLine(" if (methodInfo != null)");
|
| | | sb.AppendLine(" {");
|
| | |
| | | // 关闭窗口逻辑 |
| | | UIManager.Instance.CloseWindow(windowName); |
| | | } |
| | | if (GUILayout.Button("关闭所有窗口再打开BattleWin")) |
| | | { |
| | | foreach (var win in uiNameList) |
| | | { |
| | | UIManager.Instance.CloseWindow(win); |
| | | } |
| | | |
| | | UIManager.Instance.OpenWindow("BattleWin"); |
| | | } |
| | | |
| | | EditorGUILayout.EndHorizontal(); |
| | | } |
| | | } |
New file |
| | |
| | | AppointItemConfig |
| | | AudioConfig |
| | | ChatBubbleBoxConfig |
| | | ChestsConfig |
| | | CTGSelectItemConfig |
| | | DailyLivenessRewardConfig |
| | | DailyQuestConfig |
| | | DailyQuestOpenTimeConfig |
| | | DienstgradConfig |
| | | DirtyNameConfig |
| | | EffectConfig |
| | | EmojiPackConfig |
| | | EquipPlaceMapConfig |
| | | FamilyConfig |
| | | FamilyEmblemConfig |
| | | FirstGoldConfig |
| | | FrameAnimationConfig |
| | | FuncConfigConfig |
| | | FuncOpenLVConfig |
| | | FunctionTeamSetConfig |
| | | GetItemWaysConfig |
| | | GmCmdConfig |
| | | GuideConfig |
| | | HeroAwakeConfig |
| | | HeroBreakConfig |
| | | HeroConfig |
| | | HeroFetterConfig |
| | | HeroQualityAwakeConfig |
| | | HeroQualityBreakConfig |
| | | HeroQualityConfig |
| | | HeroSkinConfig |
| | | HeroTalentConfig |
| | | IconConfig |
| | | ItemConfig |
| | | KickOutReasonConfig |
| | | LanguageConfig |
| | | MailConfig |
| | | PlayerFaceConfig |
| | | PlayerFacePicConfig |
| | | PlayerPropertyConfig |
| | | priorbundleConfig |
| | | RealmConfig |
| | | RealmLVUPTaskConfig |
| | | RichTextMsgReplaceConfig |
| | | RuleConfig |
| | | SkillConfig |
| | | TaskConfig |
| | | TreasureCntAwardConfig |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7b3f592d4b2538c4fab144f9e7e31202 |
| | | TextScriptImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |