三国卡牌客户端基础资源仓库
yyl
10 天以前 4bb1fb5ec2eec2b740ac529ae75e07c15b67d3a7
localres前置资源包装
3个文件已修改
171 ■■■■■ 已修改文件
Assets/AssetBundleCollectorSetting.asset 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/AssetBundleBrowser/AssetBundleBuildTab.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/YooAsset/YooAssetBuildTool.cs 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/AssetBundleCollectorSetting.asset
@@ -89,14 +89,6 @@
      AssetTags: 
      ActiveRuleName: EnableGroup
      Collectors:
      - CollectPath: Assets/ResourcesOut/BuiltIn
        CollectorGUID: e5f9df9a324df2b46b1a92fa8da26b67
        CollectorType: 0
        AddressRuleName: AddressByRelativePath
        PackRuleName: PackDirectory
        FilterRuleName: CollectAll
        AssetTags:
        UserData:
      - CollectPath: Assets/ResourcesOut/Shader
        CollectorGUID: 01ad80e2bb073fb46ad906e3572fbe50
        CollectorType: 0
@@ -135,6 +127,19 @@
        AddressRuleName: AddressByRelativePath
        PackRuleName: PackDirectory
        FilterRuleName: CollectConfigExcludeOPConfig
        AssetTags:
        UserData:
    - GroupName: BuiltinAfterUpdate
      GroupDesc:
      AssetTags:
      ActiveRuleName: EnableGroup
      Collectors:
      - CollectPath: Assets/ResourcesOut/BuiltIn
        CollectorGUID: e5f9df9a324df2b46b1a92fa8da26b67
        CollectorType: 0
        AddressRuleName: AddressByRelativePath
        PackRuleName: PackDirectory
        FilterRuleName: CollectBuiltinAfterUpdate
        AssetTags: 
        UserData: 
  - PackageName: Dll
@@ -273,12 +278,73 @@
      GroupDesc: 
      AssetTags: 
      ActiveRuleName: EnableGroup
      Collectors: []
    - GroupName: ResBeforeUpdate
      GroupDesc:
      AssetTags:
      ActiveRuleName: EnableGroup
      Collectors:
      - CollectPath: Assets/ResourcesOut/BuiltIn
        CollectorGUID: e5f9df9a324df2b46b1a92fa8da26b67
      - CollectPath: Assets/ResourcesOut/BuiltIn/Prefabs/LaunchExWin.prefab
        CollectorGUID: 47197a2719503114b8f5e31e9ebd5681
        CollectorType: 0
        AddressRuleName: AddressByRelativePath
        PackRuleName: PackDirectory
        PackRuleName: PackSeparately
        FilterRuleName: CollectAll
        AssetTags:
        UserData:
      - CollectPath: Assets/ResourcesOut/BuiltIn/Sprites/TY_TB_JH1.png
        CollectorGUID: b97cb389470e86a4497784c6f8ef25c7
        CollectorType: 0
        AddressRuleName: AddressByRelativePath
        PackRuleName: PackSeparately
        FilterRuleName: CollectAll
        AssetTags:
        UserData:
      - CollectPath: Assets/ResourcesOut/BuiltIn/Sprites/TY_TB_JH2.png
        CollectorGUID: deefbcc93bc197e4db4e10a29c3bbac3
        CollectorType: 0
        AddressRuleName: AddressByRelativePath
        PackRuleName: PackSeparately
        FilterRuleName: CollectAll
        AssetTags:
        UserData:
      - CollectPath: Assets/ResourcesOut/BuiltIn/Sprites/LoadingBottom.png
        CollectorGUID: a62ce07e7f8dcef49bfe3678e8ec09c2
        CollectorType: 0
        AddressRuleName: AddressByRelativePath
        PackRuleName: PackSeparately
        FilterRuleName: CollectAll
        AssetTags:
        UserData:
      - CollectPath: Assets/ResourcesOut/BuiltIn/Sprites/LoadingSlider.png
        CollectorGUID: c610422c20ccc42c39cb773afbe86a29
        CollectorType: 0
        AddressRuleName: AddressByRelativePath
        PackRuleName: PackSeparately
        FilterRuleName: CollectAll
        AssetTags:
        UserData:
      - CollectPath: Assets/ResourcesOut/Config/InitialFunction.txt
        CollectorGUID: ab2ea28be4c891a4e81ddf6317e8f7c0
        CollectorType: 0
        AddressRuleName: AddressByRelativePath
        PackRuleName: PackSeparately
        FilterRuleName: CollectAll
        AssetTags:
        UserData:
      - CollectPath: Assets/ResourcesOut/Config/PriorLanguage.txt
        CollectorGUID: 10564c412fe84634e88b92c0b377a152
        CollectorType: 0
        AddressRuleName: AddressByRelativePath
        PackRuleName: PackSeparately
        FilterRuleName: CollectAll
        AssetTags:
        UserData:
      - CollectPath: Assets/ResourcesOut/Config/PriorBundle.txt
        CollectorGUID: fa5dd5fa8b0c89649893a3791066c4f5
        CollectorType: 0
        AddressRuleName: AddressByRelativePath
        PackRuleName: PackSeparately
        FilterRuleName: CollectAll
        AssetTags: 
        UserData: 
Assets/Editor/AssetBundleBrowser/AssetBundleBuildTab.cs
@@ -596,8 +596,10 @@
        private void CopyToStreamingAssets()
        {
            // YooAsset 打包时已通过 ClearAndCopyAll 自动拷贝到 StreamingAssets/yoo/
            Debug.Log("[AssetBundleBuildTab] YooAsset 模式下打包已自动拷贝到 StreamingAssets,无需手动操作。");
            if (YooAssetBuildTool.CopyStartupConfigsToStreamingAssets())
            {
                AssetDatabase.Refresh();
            }
        }
        private void ExecuteBuildAll()
@@ -624,9 +626,14 @@
            EditorUtility.ClearProgressBar();
            if (ok)
            {
                YooAssetBuildTool.CopyStartupConfigsToStreamingAssets();
                Debug.Log($"[AssetBundleBuildTab] Package '{yooPackageName}' 打包成功!");
            }
            else
            {
                Debug.LogError($"[AssetBundleBuildTab] Package '{yooPackageName}' 打包失败!");
            }
            AssetDatabase.Refresh();
        }
Assets/Editor/YooAsset/YooAssetBuildTool.cs
@@ -461,8 +461,78 @@
        string summary = $"打包完成!成功: {successCount}, 失败: {failCount}, 耗时: {sw.Elapsed.TotalSeconds:F1}秒";
        Debug.Log($"[YooAssetBuildTool] ========== {summary} ==========");
        bool success = failCount == 0;
        if (success)
        {
            success = CopyStartupConfigsToStreamingAssets();
        }
        AssetDatabase.Refresh();
        return failCount == 0;
        return success;
    }
    public static bool CopyStartupConfigsToStreamingAssets()
    {
        string sourceConfigDir = System.IO.Path.Combine(Application.dataPath, "ResourcesOut", "Config");
        string streamingAssetsDir = System.IO.Path.Combine(Application.dataPath, "StreamingAssets", "yoo");
        string streamingConfigDir = System.IO.Path.Combine(streamingAssetsDir, "config");
        if (!System.IO.Directory.Exists(sourceConfigDir))
        {
            Debug.LogError($"[YooAssetBuildTool] 启动配置源目录不存在: {sourceConfigDir}");
            return false;
        }
        System.IO.Directory.CreateDirectory(streamingAssetsDir);
        System.IO.Directory.CreateDirectory(streamingConfigDir);
        bool success = true;
        string initialFunctionSrc = System.IO.Path.Combine(sourceConfigDir, "InitialFunction.txt");
        string initialFunctionDst = System.IO.Path.Combine(streamingAssetsDir, "InitialFunction.txt");
        if (System.IO.File.Exists(initialFunctionSrc))
        {
            System.IO.File.Copy(initialFunctionSrc, initialFunctionDst, true);
        }
        else
        {
            Debug.LogError($"[YooAssetBuildTool] InitialFunction.txt 不存在: {initialFunctionSrc}");
            success = false;
        }
        foreach (var oldFile in System.IO.Directory.GetFiles(streamingConfigDir, "*", System.IO.SearchOption.TopDirectoryOnly))
        {
            if (IsOPConfigFileName(oldFile))
            {
                System.IO.File.Delete(oldFile);
            }
        }
        int opConfigCount = 0;
        foreach (var sourceFile in System.IO.Directory.GetFiles(sourceConfigDir, "*", System.IO.SearchOption.TopDirectoryOnly))
        {
            if (!IsOPConfigFileName(sourceFile))
            {
                continue;
            }
            string destFile = System.IO.Path.Combine(streamingConfigDir, System.IO.Path.GetFileName(sourceFile));
            System.IO.File.Copy(sourceFile, destFile, true);
            opConfigCount++;
        }
        if (opConfigCount == 0)
        {
            Debug.LogWarning($"[YooAssetBuildTool] 未找到 OPConfig 配置: {sourceConfigDir}");
        }
        Debug.Log($"[YooAssetBuildTool] 已拷贝启动配置到 StreamingAssets: InitialFunction={(System.IO.File.Exists(initialFunctionDst) ? "ok" : "missing")}, OPConfig={opConfigCount}, 目录={streamingAssetsDir}");
        return success;
    }
    private static bool IsOPConfigFileName(string path)
    {
        string fileName = System.IO.Path.GetFileName(path);
        return fileName.EndsWith("OPConfig.txt", StringComparison.OrdinalIgnoreCase);
    }
    /// <summary>