三国卡牌客户端基础资源仓库
yyl
2026-02-12 b971112ba92ba116a76a6dfbc2dde3a6f3d34095
编辑器 模拟使用资源部分
31个文件已删除
6个文件已修改
4个文件已添加
987 ■■■■■ 已修改文件
Assets/AssetBundleCollectorSetting.asset 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/YooAsset/AddressByFolderAndFileNameWithExt.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/YooAsset/AddressByFolderAndFileNameWithExt.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/YooAsset/AddressByRelativePath.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/YooAsset/YooAssetBuildTool.cs 312 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/YooAsset/YooAssetBuildTool.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Launch/Config/AssetSource.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Launch/Launch.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Launch/Manager/YooAssetInitializer.cs 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Resources/VersionConfigEx.txt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/1.0.0/1f8cbe9dbf06ffa6eaf99cb5355a8dca.bundle 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/1.0.0/987c91cb69c16c4a3d52f120133936c0.bundle 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/1.0.0/BuildinCatalog.bytes 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/1.0.0/BuildinCatalog.json 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/1.0.0/OutputCache 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/1.0.0/OutputCache.manifest 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/1.0.0/Prefab.version 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/1.0.0/Prefab_1.0.0.bytes 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/1.0.0/Prefab_1.0.0.hash 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/1.0.0/Prefab_1.0.0.json 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/1.0.0/Prefab_1.0.0.report 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/OutputCache/OutputCache 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/OutputCache/OutputCache.manifest 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/OutputCache/prefab_assets_resourcesout_prefab_battle.bundle 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/OutputCache/prefab_assets_resourcesout_prefab_battle.bundle.manifest 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/OutputCache/prefab_assets_resourcesout_prefab_place.bundle 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/Prefab/OutputCache/prefab_assets_resourcesout_prefab_place.bundle.manifest 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/1.0.0/BuildinCatalog.bytes 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/1.0.0/BuildinCatalog.json 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/1.0.0/OutputCache 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/1.0.0/OutputCache.manifest 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/1.0.0/UI.version 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/1.0.0/UI_1.0.0.bytes 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/1.0.0/UI_1.0.0.hash 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/1.0.0/UI_1.0.0.json 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/1.0.0/UI_1.0.0.report 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/1.0.0/d50470f323aa866d2c467d86397f06db.bundle 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/OutputCache/OutputCache 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/OutputCache/OutputCache.manifest 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/OutputCache/ui_assets_resourcesout_ui.bundle 补丁 | 查看 | 原始文档 | blame | 历史
Bundles/StandaloneWindows64/UI/OutputCache/ui_assets_resourcesout_ui.bundle.manifest 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/AssetBundleCollectorSetting.asset
@@ -168,7 +168,7 @@
      - CollectPath: Assets/ResourcesOut/UIEffect
        CollectorGUID: 62eb3abc624381e4b8950f355812a8e9
        CollectorType: 0
        AddressRuleName: AddressByFolderAndFileName
        AddressRuleName: AddressByFolderAndFileNameWithExt
        PackRuleName: PackDirectory
        FilterRuleName: CollectAll
        AssetTags: 
Assets/Editor/YooAsset/AddressByFolderAndFileNameWithExt.cs
New file
@@ -0,0 +1,26 @@
// ============================================================================
// AddressByFolderAndFileNameWithExt.cs — 自定义 YooAsset 地址规则
// 使用 "目录名_文件名(含扩展名)" 作为地址
// 避免同目录下同名不同扩展名文件的地址冲突
// ============================================================================
using System.IO;
using YooAsset.Editor;
/// <summary>
/// 定位地址 = 文件所在目录名 + "_" + 文件名(含扩展名)。
/// 例如 AssetPath = "Assets/ResourcesOut/UIEffect/BattleSpine/510013_Wei/attack_SkeletonData.asset"
///      → 地址 = "510013_Wei_attack_SkeletonData.asset"
/// 与内置 AddressByFolderAndFileName 的区别:保留文件扩展名,避免
/// 同目录下 .asset / .png 等同基础名文件的地址冲突。
/// </summary>
[DisplayName("定位地址: 文件夹名+文件名(含扩展名)")]
public class AddressByFolderAndFileNameWithExt : IAddressRule
{
    string IAddressRule.GetAssetAddress(AddressRuleData data)
    {
        string fileName = Path.GetFileName(data.AssetPath);
        FileInfo fileInfo = new FileInfo(data.AssetPath);
        return $"{fileInfo.Directory.Name}_{fileName}";
    }
}
Assets/Editor/YooAsset/AddressByFolderAndFileNameWithExt.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ee466724639fabe41acd8d9094a64c14
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/Editor/YooAsset/AddressByRelativePath.cs
@@ -1,19 +1,21 @@
// ============================================================================
// AddressByRelativePath.cs — 自定义 YooAsset 地址规则
// 使用相对于 CollectPath 的完整路径(不含扩展名)作为地址
// 解决同 Package 内不同子目录下同名文件的地址冲突
// 使用相对于 CollectPath 的完整路径(含扩展名)作为地址
// 避免同目录下同名不同扩展名文件的地址冲突
// ============================================================================
using System.IO;
using YooAsset.Editor;
/// <summary>
/// 定位地址 = 资源相对于收集目录的路径(不含扩展名)。
/// 定位地址 = 资源相对于收集目录的路径(含扩展名)。
/// 例如 CollectPath = "Assets/ResourcesOut/Audio"
///      AssetPath  = "Assets/ResourcesOut/Audio/Battle/Effect/boom.wav"
///      → 地址 = "Battle/Effect/boom"
///      → 地址 = "Battle/Effect/boom.wav"
/// 注意:SupportExtensionless 仍会为 AssetPath 自动生成无扩展名映射,
/// 这里仅是 Address 字段保留扩展名以避免冲突。
/// </summary>
[DisplayName("定位地址: 相对路径")]
[DisplayName("定位地址: 相对路径(含扩展名)")]
public class AddressByRelativePath : IAddressRule
{
    string IAddressRule.GetAssetAddress(AddressRuleData data)
@@ -31,13 +33,7 @@
            relativePath = relativePath.Substring(collectRoot.Length);
        }
        // 去掉扩展名
        string ext = Path.GetExtension(relativePath);
        if (!string.IsNullOrEmpty(ext))
        {
            relativePath = relativePath.Substring(0, relativePath.Length - ext.Length);
        }
        // 保留扩展名,避免同名不同类型文件地址冲突
        return relativePath;
    }
}
Assets/Editor/YooAsset/YooAssetBuildTool.cs
New file
@@ -0,0 +1,312 @@
// ============================================================================
// YooAssetBuildTool.cs — YooAsset 一键打包 & AB模式切换 Editor 工具
// 菜单路径: YooAsset工具/
// ============================================================================
using System;
using System.Diagnostics;
using UnityEditor;
using UnityEngine;
using YooAsset;
using YooAsset.Editor;
using Debug = UnityEngine.Debug;
public static class YooAssetBuildTool
{
    /// <summary>
    /// 所有需要打包的 Package 名称(与 AssetBundleCollectorSetting 一致)
    /// </summary>
    private static readonly string[] ALL_PACKAGES = { "Prefab", "UI", "UIEffect", "Battle", "Audio" };
    /// <summary>
    /// 版本号格式:日期+时间
    /// </summary>
    private static string GenerateVersion()
    {
        return DateTime.Now.ToString("yyyy-MM-dd-HHmm");
    }
    // ====================================================================
    // AB 模式切换
    // ====================================================================
    [MenuItem("YooAsset工具/切换AB模式 (当前: 关闭)", false, 100)]
    private static void ToggleABMode()
    {
        bool current = EditorPrefs.GetBool("YooAsset_UseAssetBundle", false);
        bool next = !current;
        EditorPrefs.SetBool("YooAsset_UseAssetBundle", next);
        string modeDesc = next ? "OfflinePlayMode (随包模式/AB模式)" : "EditorSimulateMode (编辑器模拟模式)";
        Debug.Log($"[YooAssetBuildTool] AB模式已切换为: {(next ? "开启" : "关闭")} → {modeDesc}");
        EditorUtility.DisplayDialog("AB 模式切换",
            $"AB 模式已{(next ? "开启" : "关闭")}\n\n运行模式: {modeDesc}\n\n" +
            (next ? "请确保已打包资源到 StreamingAssets!" : "将使用编辑器模拟模式,无需打包。"),
            "确定");
    }
    [MenuItem("YooAsset工具/切换AB模式 (当前: 关闭)", true)]
    private static bool ToggleABModeValidate()
    {
        bool isOn = EditorPrefs.GetBool("YooAsset_UseAssetBundle", false);
        Menu.SetChecked("YooAsset工具/切换AB模式 (当前: 关闭)", isOn);
        return true;
    }
    // ====================================================================
    // 一键打包所有 Package
    // ====================================================================
    [MenuItem("YooAsset工具/一键打包所有Package (BuiltinBuildPipeline)", false, 200)]
    private static void BuildAllPackages()
    {
        if (!EditorUtility.DisplayDialog("确认打包",
            $"将使用 BuiltinBuildPipeline 打包以下 {ALL_PACKAGES.Length} 个 Package:\n" +
            $"{string.Join(", ", ALL_PACKAGES)}\n\n" +
            $"平台: {EditorUserBuildSettings.activeBuildTarget}\n" +
            $"输出: {AssetBundleBuilderHelper.GetDefaultBuildOutputRoot()}\n" +
            $"并自动拷贝到 StreamingAssets\n\n是否继续?",
            "开始打包", "取消"))
        {
            return;
        }
        string version = GenerateVersion();
        int successCount = 0;
        int failCount = 0;
        var sw = Stopwatch.StartNew();
        Debug.Log($"[YooAssetBuildTool] ========== 开始打包 ==========");
        Debug.Log($"[YooAssetBuildTool] 版本号: {version}");
        Debug.Log($"[YooAssetBuildTool] 平台: {EditorUserBuildSettings.activeBuildTarget}");
        for (int i = 0; i < ALL_PACKAGES.Length; i++)
        {
            string pkgName = ALL_PACKAGES[i];
            EditorUtility.DisplayProgressBar("YooAsset 打包中...",
                $"正在打包 {pkgName} ({i + 1}/{ALL_PACKAGES.Length})",
                (float)i / ALL_PACKAGES.Length);
            bool ok = BuildSinglePackage(pkgName, version);
            if (ok)
                successCount++;
            else
                failCount++;
        }
        EditorUtility.ClearProgressBar();
        sw.Stop();
        string summary = $"打包完成!成功: {successCount}, 失败: {failCount}, 耗时: {sw.Elapsed.TotalSeconds:F1}秒";
        Debug.Log($"[YooAssetBuildTool] ========== {summary} ==========");
        if (failCount > 0)
        {
            EditorUtility.DisplayDialog("打包完成(有失败)", summary + "\n\n请检查 Console 日志中的错误信息。", "确定");
        }
        else
        {
            bool toggleAB = EditorUtility.DisplayDialog("打包成功!", summary + "\n\n是否立即开启 AB 模式?", "开启AB模式", "暂不开启");
            if (toggleAB)
            {
                EditorPrefs.SetBool("YooAsset_UseAssetBundle", true);
                Debug.Log("[YooAssetBuildTool] AB模式已开启,运行模式: OfflinePlayMode");
            }
        }
        AssetDatabase.Refresh();
    }
    // ====================================================================
    // 单个 Package 打包
    // ====================================================================
    [MenuItem("YooAsset工具/打包单个Package/Prefab", false, 300)]
    private static void BuildPrefab() => BuildSingleWithDialog("Prefab");
    [MenuItem("YooAsset工具/打包单个Package/UI", false, 301)]
    private static void BuildUI() => BuildSingleWithDialog("UI");
    [MenuItem("YooAsset工具/打包单个Package/UIEffect", false, 302)]
    private static void BuildUIEffect() => BuildSingleWithDialog("UIEffect");
    [MenuItem("YooAsset工具/打包单个Package/Battle", false, 303)]
    private static void BuildBattle() => BuildSingleWithDialog("Battle");
    [MenuItem("YooAsset工具/打包单个Package/Audio", false, 304)]
    private static void BuildAudio() => BuildSingleWithDialog("Audio");
    private static void BuildSingleWithDialog(string packageName)
    {
        string version = GenerateVersion();
        if (!EditorUtility.DisplayDialog("确认打包",
            $"打包 Package: {packageName}\n版本: {version}\n平台: {EditorUserBuildSettings.activeBuildTarget}",
            "开始", "取消"))
        {
            return;
        }
        EditorUtility.DisplayProgressBar("YooAsset 打包中...", $"正在打包 {packageName}...", 0.5f);
        bool ok = BuildSinglePackage(packageName, version);
        EditorUtility.ClearProgressBar();
        if (ok)
        {
            EditorUtility.DisplayDialog("打包成功", $"Package '{packageName}' 打包完成!", "确定");
        }
        else
        {
            EditorUtility.DisplayDialog("打包失败", $"Package '{packageName}' 打包失败,请查看 Console 日志。", "确定");
        }
        AssetDatabase.Refresh();
    }
    /// <summary>
    /// 打包单个 Package
    /// </summary>
    private static bool BuildSinglePackage(string packageName, string version)
    {
        try
        {
            Debug.Log($"[YooAssetBuildTool] 开始打包 Package: {packageName}, 版本: {version}");
            var buildParameters = new BuiltinBuildParameters();
            buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
            buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
            buildParameters.BuildPipeline = EBuildPipeline.BuiltinBuildPipeline.ToString();
            buildParameters.BuildBundleType = (int)EBuildBundleType.AssetBundle;
            buildParameters.BuildTarget = EditorUserBuildSettings.activeBuildTarget;
            buildParameters.PackageName = packageName;
            buildParameters.PackageVersion = version;
            buildParameters.EnableSharePackRule = true;
            buildParameters.VerifyBuildingResult = true;
            buildParameters.FileNameStyle = EFileNameStyle.HashName;
            buildParameters.BuildinFileCopyOption = EBuildinFileCopyOption.ClearAndCopyAll;
            buildParameters.BuildinFileCopyParams = string.Empty;
            buildParameters.CompressOption = ECompressOption.LZ4;
            buildParameters.ClearBuildCacheFiles = false;
            buildParameters.UseAssetDependencyDB = true;
            buildParameters.EncryptionServices = null;
            var pipeline = new BuiltinBuildPipeline();
            BuildResult buildResult = pipeline.Run(buildParameters, true);
            if (buildResult.Success)
            {
                Debug.Log($"[YooAssetBuildTool] ✓ Package '{packageName}' 打包成功!输出: {buildResult.OutputPackageDirectory}");
                return true;
            }
            else
            {
                Debug.LogError($"[YooAssetBuildTool] ✗ Package '{packageName}' 打包失败: Task={buildResult.FailedTask}, Error={buildResult.ErrorInfo}");
                return false;
            }
        }
        catch (Exception ex)
        {
            Debug.LogError($"[YooAssetBuildTool] ✗ Package '{packageName}' 打包异常: {ex}");
            return false;
        }
    }
    // ====================================================================
    // 清理工具
    // ====================================================================
    [MenuItem("YooAsset工具/清理 StreamingAssets 中的 YooAsset 资源", false, 400)]
    private static void CleanStreamingAssets()
    {
        string root = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
        if (!System.IO.Directory.Exists(root))
        {
            EditorUtility.DisplayDialog("清理", "StreamingAssets 中没有 YooAsset 资源。", "确定");
            return;
        }
        if (EditorUtility.DisplayDialog("确认清理",
            $"将删除 StreamingAssets 中的所有 YooAsset 资源:\n{root}\n\n是否继续?",
            "删除", "取消"))
        {
            System.IO.Directory.Delete(root, true);
            // 同时删除 .meta 文件
            string metaPath = root + ".meta";
            if (System.IO.File.Exists(metaPath))
                System.IO.File.Delete(metaPath);
            AssetDatabase.Refresh();
            Debug.Log($"[YooAssetBuildTool] 已清理: {root}");
            EditorUtility.DisplayDialog("清理完成", "StreamingAssets 中的 YooAsset 资源已清理。", "确定");
        }
    }
    [MenuItem("YooAsset工具/清理 Bundles 构建输出目录", false, 401)]
    private static void CleanBuildOutput()
    {
        string root = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
        if (!System.IO.Directory.Exists(root))
        {
            EditorUtility.DisplayDialog("清理", "Bundles 构建输出目录不存在。", "确定");
            return;
        }
        if (EditorUtility.DisplayDialog("确认清理",
            $"将删除所有构建输出:\n{root}\n\n是否继续?",
            "删除", "取消"))
        {
            System.IO.Directory.Delete(root, true);
            Debug.Log($"[YooAssetBuildTool] 已清理: {root}");
            EditorUtility.DisplayDialog("清理完成", "Bundles 构建输出目录已清理。", "确定");
        }
    }
    // ====================================================================
    // 状态查看
    // ====================================================================
    [MenuItem("YooAsset工具/查看当前状态", false, 500)]
    private static void ShowStatus()
    {
        bool isABMode = EditorPrefs.GetBool("YooAsset_UseAssetBundle", false);
        string streamingRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
        string buildRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
        string streamingStatus = "未找到";
        if (System.IO.Directory.Exists(streamingRoot))
        {
            var dirs = System.IO.Directory.GetDirectories(streamingRoot);
            streamingStatus = $"存在 ({dirs.Length} 个子目录)";
            foreach (var d in dirs)
            {
                streamingStatus += $"\n  - {System.IO.Path.GetFileName(d)}";
            }
        }
        string buildStatus = "未找到";
        if (System.IO.Directory.Exists(buildRoot))
        {
            string platformDir = System.IO.Path.Combine(buildRoot, EditorUserBuildSettings.activeBuildTarget.ToString());
            if (System.IO.Directory.Exists(platformDir))
            {
                var dirs = System.IO.Directory.GetDirectories(platformDir);
                buildStatus = $"存在 ({dirs.Length} 个包)";
                foreach (var d in dirs)
                {
                    buildStatus += $"\n  - {System.IO.Path.GetFileName(d)}";
                }
            }
            else
            {
                buildStatus = "存在但无当前平台构建";
            }
        }
        string msg =
            $"AB 模式: {(isABMode ? "开启 (OfflinePlayMode)" : "关闭 (EditorSimulateMode)")}\n\n" +
            $"平台: {EditorUserBuildSettings.activeBuildTarget}\n\n" +
            $"StreamingAssets ({streamingRoot}):\n{streamingStatus}\n\n" +
            $"构建输出 ({buildRoot}):\n{buildStatus}";
        EditorUtility.DisplayDialog("YooAsset 状态", msg, "确定");
    }
}
Assets/Editor/YooAsset/YooAssetBuildTool.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1340abe152ecbfb41aca6902e7cc7708
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/Launch/Config/AssetSource.cs
@@ -1,24 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;
public class AssetSource
{
    /// <summary>
    /// 编辑器下通过 EditorPrefs 持久化 AB 模式开关(不受 PlayerPrefs 清理影响)。
    /// 非编辑器环境始终返回 true。
    /// </summary>
    public static bool isUseAssetBundle
    {
        get
        {
#if UNITY_EDITOR
            //本机测试下载资源 需拷贝基本文本资源到 Assets\StreamingAssets\android下,为了方便直接拷贝所有资源即可
            if (!PlayerPrefs.HasKey("InGameDownLoadTestEanble"))
            {
                return false;
            }
            else
            {
                return PlayerPrefs.GetInt("InGameDownLoadTestEanble") == 1;
            }
            return UnityEditor.EditorPrefs.GetBool("YooAsset_UseAssetBundle", false);
#else
            return true;
#endif
Assets/Launch/Launch.cs
@@ -52,7 +52,7 @@
        m_Instance = this;
#if !UNITY_EDITOR && !UNITY_WEBGL
#if !UNITY_EDITOR
        if (File.Exists(Directory.GetParent(Application.persistentDataPath) + "/Debug") ||
        LocalSave.GetString("#@#BrancH") != string.Empty)
        {
@@ -91,7 +91,9 @@
        try
        {
#if UNITY_EDITOR
            var playMode = EPlayMode.EditorSimulateMode;
            // 编辑器下:如果开启了 AB 模式(AssetSource.isUseAssetBundle),使用 OfflinePlayMode(随包模式)
            // 否则使用 EditorSimulateMode(无需打包即可运行)
            var playMode = AssetSource.isUseAssetBundle ? EPlayMode.OfflinePlayMode : EPlayMode.EditorSimulateMode;
#elif UNITY_WEBGL
            var playMode = EPlayMode.WebPlayMode;
#else
Assets/Launch/Manager/YooAssetInitializer.cs
@@ -119,15 +119,33 @@
            {
                try
                {
                    var package = YooAssets.CreatePackage(pkgName);
                    var initParams = CreateInitParameters(playMode, remoteServices, pkgName);
                    // 先验证初始化参数(如 SimulateBuild),避免 CreatePackage 后抛异常留下僵尸包裹
                    InitializeParameters initParams;
                    try
                    {
                        initParams = CreateInitParameters(playMode, remoteServices, pkgName);
                    }
                    catch (Exception paramEx)
                    {
                        Debug.LogError($"[YooAssetInitializer] Package '{pkgName}' CreateInitParameters FAILED (skipped): {paramEx.Message}\n{paramEx.StackTrace}");
                        continue;
                    }
                    var package = YooAssets.CreatePackage(pkgName);
                    var initOp = package.InitializeAsync(initParams);
                    await initOp.ToUniTask();
                    if (initOp.Status != EOperationStatus.Succeed)
                    {
                        Debug.LogWarning($"[YooAssetInitializer] Package '{pkgName}' init failed: {initOp.Error}");
                        // 清理失败的包裹,避免僵尸包裹
                        try
                        {
                            var destroyOp = package.DestroyAsync();
                            await destroyOp.ToUniTask();
                            YooAssets.RemovePackage(pkgName);
                        }
                        catch { /* ignore cleanup errors */ }
                        continue;
                    }
@@ -145,7 +163,25 @@
                }
                catch (Exception ex)
                {
                    // EditorSimulateMode 下包不在 Collector 中会抛异常,跳过即可
                    // 如果 CreatePackage 成功但后续失败,清理僵尸包裹
                    var zombiePkg = YooAssets.TryGetPackage(pkgName);
                    if (zombiePkg != null)
                    {
                        try
                        {
                            if (zombiePkg.InitializeStatus == EOperationStatus.None)
                            {
                                // 未初始化可以直接移除
                                YooAssets.RemovePackage(pkgName);
                            }
                            else
                            {
                                // 已初始化需先销毁再移除(但这里是 catch 块,无法 await)
                                // 配合 YooAssetService 的自愈机制处理
                            }
                        }
                        catch { /* ignore cleanup errors */ }
                    }
                    Debug.LogWarning($"[YooAssetInitializer] Package '{pkgName}' init exception (skipped): {ex.Message}");
                }
            }
@@ -159,7 +195,20 @@
            }
            State = InitState.Initialized;
            Debug.Log($"[YooAssetInitializer] Initialized {successCount}/{names.Length} packages with PlayMode={playMode}");
            // 输出初始化摘要
            var failedPkgs = new System.Collections.Generic.List<string>();
            foreach (var pkgN in names)
            {
                if (!_packages.ContainsKey(pkgN))
                    failedPkgs.Add(pkgN);
            }
            if (failedPkgs.Count > 0)
            {
                Debug.LogError($"[YooAssetInitializer] {failedPkgs.Count} package(s) FAILED: [{string.Join(", ", failedPkgs)}]. " +
                    "Check earlier console errors (look for 'CreateInitParameters FAILED' or 'SimulateBuild' errors).");
            }
            Debug.Log($"[YooAssetInitializer] Initialized {successCount}/{names.Length} packages with PlayMode={playMode}. " +
                $"Active: [{string.Join(", ", _packages.Keys)}]");
        }
        catch (Exception ex)
        {
@@ -175,22 +224,13 @@
    /// <summary>
    /// 请求最新版本号并更新 Manifest(对所有已初始化的包裹)。
    /// 仅在 HostPlayMode 下有意义,EditorSimulateMode / OfflinePlayMode 下跳过。
    /// 所有运行模式都需要执行此步骤以加载 ActiveManifest。
    /// </summary>
    public async UniTask RequestVersionAndUpdateAsync()
    {
        if (State != InitState.Initialized)
        {
            Debug.LogWarning($"[YooAssetInitializer] Invalid state for RequestVersionAndUpdate: {State}");
            return;
        }
        // EditorSimulateMode / OfflinePlayMode 不需要远程版本管理
        if (_playMode == EPlayMode.EditorSimulateMode || _playMode == EPlayMode.OfflinePlayMode)
        {
            State = InitState.VersionChecked;
            State = InitState.Ready;
            Debug.Log("[YooAssetInitializer] Skipped version check (local mode). State → Ready");
            return;
        }
Assets/Resources/VersionConfigEx.txt
@@ -1 +1 @@
{"m_AppId":"test","m_SpID":"test","m_VersionAuthority":0,"m_Version":"1.0.1","m_ClientPackageFlag":"2021","m_Branch":1,"m_AssetAccess":0,"m_PartAssetPackage":false,"m_ProductName":"像素三国","m_BundleIdentifier":"com.wgyx.xssg","m_KeystoreFileName":"wgyx","m_KeystorePassword":"wgyx2025","m_KeystoreAlias":"wgyx","m_KeystoreAliasPassword":"wgyx2025","m_AppleDeveloperTeamID":"","m_DebugVersion":true,"m_IsBanShu":false,"m_BuildTime":"","m_BuildIndex":6,"m_LogoPosition":{"x":-32.0,"y":144.0},"m_BanHao":"","m_SdkFileName":""}
{"m_AppId":"test","m_SpID":"test","m_VersionAuthority":0,"m_Version":"1.0.1","m_ClientPackageFlag":"2021","m_Branch":1,"m_AssetAccess":3,"m_PartAssetPackage":false,"m_ProductName":"像素三国","m_BundleIdentifier":"com.wgyx.xssg","m_KeystoreFileName":"wgyx","m_KeystorePassword":"wgyx2025","m_KeystoreAlias":"wgyx","m_KeystoreAliasPassword":"wgyx2025","m_AppleDeveloperTeamID":"","m_DebugVersion":true,"m_IsBanShu":false,"m_BuildTime":"","m_BuildIndex":6,"m_LogoPosition":{"x":-32.0,"y":144.0},"m_BanHao":"","m_SdkFileName":""}
Bundles/StandaloneWindows64/Prefab/1.0.0/1f8cbe9dbf06ffa6eaf99cb5355a8dca.bundle
Binary files differ
Bundles/StandaloneWindows64/Prefab/1.0.0/987c91cb69c16c4a3d52f120133936c0.bundle
Binary files differ
Bundles/StandaloneWindows64/Prefab/1.0.0/BuildinCatalog.bytes
Binary files differ
Bundles/StandaloneWindows64/Prefab/1.0.0/BuildinCatalog.json
File was deleted
Bundles/StandaloneWindows64/Prefab/1.0.0/OutputCache
Binary files differ
Bundles/StandaloneWindows64/Prefab/1.0.0/OutputCache.manifest
File was deleted
Bundles/StandaloneWindows64/Prefab/1.0.0/Prefab.version
File was deleted
Bundles/StandaloneWindows64/Prefab/1.0.0/Prefab_1.0.0.bytes
Binary files differ
Bundles/StandaloneWindows64/Prefab/1.0.0/Prefab_1.0.0.hash
File was deleted
Bundles/StandaloneWindows64/Prefab/1.0.0/Prefab_1.0.0.json
File was deleted
Bundles/StandaloneWindows64/Prefab/1.0.0/Prefab_1.0.0.report
File was deleted
Bundles/StandaloneWindows64/Prefab/OutputCache/OutputCache
Binary files differ
Bundles/StandaloneWindows64/Prefab/OutputCache/OutputCache.manifest
File was deleted
Bundles/StandaloneWindows64/Prefab/OutputCache/prefab_assets_resourcesout_prefab_battle.bundle
Binary files differ
Bundles/StandaloneWindows64/Prefab/OutputCache/prefab_assets_resourcesout_prefab_battle.bundle.manifest
File was deleted
Bundles/StandaloneWindows64/Prefab/OutputCache/prefab_assets_resourcesout_prefab_place.bundle
Binary files differ
Bundles/StandaloneWindows64/Prefab/OutputCache/prefab_assets_resourcesout_prefab_place.bundle.manifest
File was deleted
Bundles/StandaloneWindows64/UI/1.0.0/BuildinCatalog.bytes
Binary files differ
Bundles/StandaloneWindows64/UI/1.0.0/BuildinCatalog.json
File was deleted
Bundles/StandaloneWindows64/UI/1.0.0/OutputCache
Binary files differ
Bundles/StandaloneWindows64/UI/1.0.0/OutputCache.manifest
File was deleted
Bundles/StandaloneWindows64/UI/1.0.0/UI.version
File was deleted
Bundles/StandaloneWindows64/UI/1.0.0/UI_1.0.0.bytes
Binary files differ
Bundles/StandaloneWindows64/UI/1.0.0/UI_1.0.0.hash
File was deleted
Bundles/StandaloneWindows64/UI/1.0.0/UI_1.0.0.json
File was deleted
Bundles/StandaloneWindows64/UI/1.0.0/UI_1.0.0.report
File was deleted
Bundles/StandaloneWindows64/UI/1.0.0/d50470f323aa866d2c467d86397f06db.bundle
Binary files differ
Bundles/StandaloneWindows64/UI/OutputCache/OutputCache
Binary files differ
Bundles/StandaloneWindows64/UI/OutputCache/OutputCache.manifest
File was deleted
Bundles/StandaloneWindows64/UI/OutputCache/ui_assets_resourcesout_ui.bundle
Binary files differ
Bundles/StandaloneWindows64/UI/OutputCache/ui_assets_resourcesout_ui.bundle.manifest
File was deleted