三国卡牌客户端基础资源仓库
yyl
2026-05-15 0229e944a9f77b8622ae2b34ef0fa314a8aa0fc2
Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_client
4个文件已修改
161 ■■■■ 已修改文件
Assets/Editor/SpritePacking/SpriteSettings.asset 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/ChangeTextAndImage.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/ClientPackage.cs 105 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Launch/Launch.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/SpritePacking/SpriteSettings.asset
@@ -1619,6 +1619,28 @@
      maxTextureSize: 2048
      textureCompression: 1
      textureFormat: 50
  - folderName: HeroDebutHero_540017
    blockOffset: 1
    enableRotation: 0
    enableTightPacking: 0
    padding: 4
    readable: 0
    generateMipMaps: 0
    sRGB: 1
    filterMode: 1
    platformSettings:
    - name: Standalone
      maxTextureSize: 2048
      textureCompression: 1
      textureFormat: 4
    - name: Android
      maxTextureSize: 2048
      textureCompression: 1
      textureFormat: 50
    - name: iPhone
      maxTextureSize: 2048
      textureCompression: 1
      textureFormat: 50
  - folderName: SkinGift
    blockOffset: 1
    enableRotation: 0
@@ -1751,3 +1773,25 @@
      maxTextureSize: 2048
      textureCompression: 1
      textureFormat: 50
  - folderName: SuperVIP
    blockOffset: 1
    enableRotation: 0
    enableTightPacking: 0
    padding: 4
    readable: 0
    generateMipMaps: 0
    sRGB: 1
    filterMode: 1
    platformSettings:
    - name: Standalone
      maxTextureSize: 2048
      textureCompression: 1
      textureFormat: 4
    - name: Android
      maxTextureSize: 2048
      textureCompression: 1
      textureFormat: 50
    - name: iPhone
      maxTextureSize: 2048
      textureCompression: 1
      textureFormat: 50
Assets/Editor/Tool/ChangeTextAndImage.cs
@@ -78,7 +78,12 @@
            TextEx textEx = go.AddMissingComponent<TextEx>();
            textEx.text = textContent;
            textEx.font = FontUtility.preferred;
            var font = FontUtility.preferred;
            if (font == null)
            {
                font = AssetDatabase.LoadAssetAtPath<Font>("Assets/ResourcesOut/Font/GameFont1.ttf");
            }
            textEx.font = font;
            textEx.fontSize = textFontSize;
            textEx.raycastTarget = false;
            textEx.alignment = TextAnchor.MiddleCenter;
Assets/Editor/Tool/ClientPackage.cs
@@ -316,8 +316,8 @@
        File.Copy(copySdkFile, File_baseProjectTemplate);
        copySdkFile = StringUtility.Concat(_sdkPath, "/Channel/Android/", versionConfig.sdkFileName, "/deps.gradle");
        File.Copy(copySdkFile, File_deps);
        copySdkFile = StringUtility.Concat(_sdkPath, "/Channel/Android/", versionConfig.sdkFileName, "/google-services.json");
        File.Copy(copySdkFile, File_google_services);
        // copySdkFile = StringUtility.Concat(_sdkPath, "/Channel/Android/", versionConfig.sdkFileName, "/google-services.json");
        // File.Copy(copySdkFile, File_google_services);
        copySdkFile = StringUtility.Concat(_sdkPath, "/Channel/Android/", versionConfig.sdkFileName, "/gradleTemplate.properties");
        File.Copy(copySdkFile, File_gradleTemplate);
        copySdkFile = StringUtility.Concat(_sdkPath, "/Channel/Android/", versionConfig.sdkFileName, "/LauncherManifest.xml");
@@ -399,40 +399,47 @@
            return;
        }
        PreBuild(_publisher, _buildIndex);
        var versionName = string.Empty;
        var versionConfig = GetVersionConfig(_publisher, out versionName);
        // 导出前清理 Assets/Plugins/Android(保留 libs 目录)
        CleanupPluginsAndroidForExport();
        string copySdkFile;
        copySdkFile = StringUtility.Concat(SDK_PLUGIN_PROJECT, "/Channel/Android/", versionConfig.sdkFileName, "/AndroidManifest.xml");
        File.Copy(copySdkFile, MANIFEST_PATH);
        PreBuild(_publisher, _buildIndex);
        PlayerSettings.Android.bundleVersionCode = VersionConfig.GetVersionNumber(versionConfig.version);
        PlayerSettings.enableInternalProfiler = _development;
        // 先清理StreamingAssets,再根据assetAccess配置拷贝资源到StreamingAssets
        var streamingPath = ResourcesPath.Instance.StreamingAssetPath;
        if (Directory.Exists(streamingPath))
            Directory.Delete(streamingPath, true);
        //完整取StreamingAssets 资源
        // // 先清理StreamingAssets,再根据assetAccess配置拷贝资源到StreamingAssets
        // var streamingPath = ResourcesPath.Instance.StreamingAssetPath;
        // if (Directory.Exists(streamingPath))
        //     Directory.Delete(streamingPath, true);
        if (!string.IsNullOrEmpty(_assetBundlePath) && Directory.Exists(_assetBundlePath))
        {
            switch (versionConfig.assetAccess)
            {
                case InstalledAsset.NullAsset:
                    CopyNullAssetResources(_assetBundlePath, streamingPath);
                    break;
                case InstalledAsset.HalfAsset:
                    CopyHalfAssetResources(_assetBundlePath, streamingPath);
                    break;
                case InstalledAsset.FullAsset:
                case InstalledAsset.IngoreDownLoad:
                    CopyFullAssetResources(_assetBundlePath, streamingPath);
                    break;
            }
            Debug.LogFormat("资源拷贝完成({0}),从 {1} 到 {2}", versionConfig.assetAccess, _assetBundlePath, streamingPath);
        }
        else
        {
            Debug.LogWarningFormat("AssetBundle路径为空或不存在: {0},导出工程将不包含游戏资源", _assetBundlePath);
        }
        // if (!string.IsNullOrEmpty(_assetBundlePath) && Directory.Exists(_assetBundlePath))
        // {
        //     switch (versionConfig.assetAccess)
        //     {
        //         case InstalledAsset.NullAsset:
        //             CopyNullAssetResources(_assetBundlePath, streamingPath);
        //             break;
        //         case InstalledAsset.HalfAsset:
        //             CopyHalfAssetResources(_assetBundlePath, streamingPath);
        //             break;
        //         case InstalledAsset.FullAsset:
        //         case InstalledAsset.IngoreDownLoad:
        //             CopyFullAssetResources(_assetBundlePath, streamingPath);
        //             break;
        //     }
        //     Debug.LogFormat("资源拷贝完成({0}),从 {1} 到 {2}", versionConfig.assetAccess, _assetBundlePath, streamingPath);
        // }
        // else
        // {
        //     Debug.LogWarningFormat("AssetBundle路径为空或不存在: {0},导出工程将不包含游戏资源", _assetBundlePath);
        // }
        // 关键设置:导出为Gradle工程而非直接打APK
        EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
@@ -908,6 +915,46 @@
        }
    }
    /// <summary>
    /// 导出 Gradle 工程前清理 Assets/Plugins/Android(保留 libs 目录)
    /// </summary>
    static void CleanupPluginsAndroidForExport()
    {
        var androidPluginPath = Path.Combine(Application.dataPath, "Plugins/Android");
        if (!Directory.Exists(androidPluginPath))
            return;
        Debug.Log("开始清理 Assets/Plugins/Android(保留 libs 目录)...");
        // 删除所有子目录(除了 libs)
        var subDirs = Directory.GetDirectories(androidPluginPath);
        foreach (var dir in subDirs)
        {
            var dirName = Path.GetFileName(dir);
            if (dirName != "libs")
            {
                Directory.Delete(dir, true);
                Debug.LogFormat("已删除 Plugins/Android/{0} 目录", dirName);
            }
        }
        // 删除根目录下的所有文件(保留 .aar 和 .aar.meta)
        var rootFiles = Directory.GetFiles(androidPluginPath);
        foreach (var file in rootFiles)
        {
            var fileName = Path.GetFileName(file);
            if (fileName.EndsWith(".aar") || fileName.EndsWith(".aar.meta"))
            {
                Debug.LogFormat("已保留文件: {0}", fileName);
                continue;
            }
            File.Delete(file);
            Debug.LogFormat("已删除文件: {0}", fileName);
        }
    }
    static BuildTargetGroup GetBuildTarget()
    {
#if UNITY_ANDROID
Assets/Launch/Launch.cs
@@ -324,7 +324,7 @@
        {
            Debug.LogError("无法找到get_Instance方法");
        }
        LocalResManager.Instance.RecordLauchEvent(6);
        LocalResManager.Instance.RecordLauchEvent(3);
        Debug.Log("进入游戏流程");
    }
@@ -378,13 +378,12 @@
            return;
        else if (LocalResManager.step == LocalResManager.LoadDllStep.RequestVersion)
        {
            LocalResManager.Instance.RecordLauchEvent(2);
            LocalResManager.step = LocalResManager.LoadDllStep.Wait;
            LocalResManager.Instance.RequestVersionCheck();
        }
        else if (LocalResManager.step == LocalResManager.LoadDllStep.ReadBytes)
        {
            LocalResManager.Instance.RecordLauchEvent(5);
            LocalResManager.Instance.RecordLauchEvent(2);
            LocalResManager.step = LocalResManager.LoadDllStep.Wait;
            ReadDllBytes(this.StartGame).Forget();
        }