三国卡牌客户端基础资源仓库
0312 打包不修改代码里的版本号,后续要对版本号进行管理;安卓有对闪图特殊处理后续排查;新资源都放UI目录下
3个文件已修改
64 ■■■■■ 已修改文件
Assets/Editor/Tool/ClientPackage.cs 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/UpdateAssetBundleName.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Launch/Common/ResourcesPath.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/ClientPackage.cs
@@ -405,23 +405,23 @@
        var versionName = string.Empty;
        var versionConfig = GetVersionConfig(_publisher, out versionName);
        var versionConfigCSpath = Application.dataPath + "/Scripts/System/ClientVersion/VersionConfig.cs";
        var text = File.ReadAllText(versionConfigCSpath);
        // var versionConfigCSpath = Application.dataPath + "/Scripts/System/ClientVersion/VersionConfig.cs";
        // var text = File.ReadAllText(versionConfigCSpath);
        if (text.Contains("VERSION_ALTERNATIVE"))
        {
            var pattern = "VERSION_ALTERNATIVE = \".*\"";
            text = Regex.Replace(text, pattern, StringUtility.Contact("VERSION_ALTERNATIVE = ", "\"", versionConfig.m_Version, "\""));
        // if (text.Contains("VERSION_ALTERNATIVE"))
        // {
        //     var pattern = "VERSION_ALTERNATIVE = \".*\"";
        //     text = Regex.Replace(text, pattern, StringUtility.Contact("VERSION_ALTERNATIVE = ", "\"", versionConfig.m_Version, "\""));
            bool encoderShouldEmitUTF8Identifier = true;
            bool throwOnInvalidBytes = false;
            UTF8Encoding encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier, throwOnInvalidBytes);
            bool append = false;
            StreamWriter streamWriter = new StreamWriter(versionConfigCSpath, append, encoding);
            streamWriter.Write(text);
            streamWriter.Close();
            AssetDatabase.ImportAsset(versionConfigCSpath);
        }
        //     bool encoderShouldEmitUTF8Identifier = true;
        //     bool throwOnInvalidBytes = false;
        //     UTF8Encoding encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier, throwOnInvalidBytes);
        //     bool append = false;
        //     StreamWriter streamWriter = new StreamWriter(versionConfigCSpath, append, encoding);
        //     streamWriter.Write(text);
        //     streamWriter.Close();
        //     AssetDatabase.ImportAsset(versionConfigCSpath);
        // }
        // 针对某一些打包的特殊性, 这里特指依赖的第三方库含有资源的问题
        // 这里对有这种特型的渠道的sdk在打包的时候差异化gradle文件
@@ -741,15 +741,15 @@
        var splashScreenLogo = PlayerSettings.SplashScreenLogo.Create(3, splashImage);
        PlayerSettings.SplashScreen.logos = new PlayerSettings.SplashScreenLogo[] { splashScreenLogo };
        if (buildTarget == BuildTargetGroup.Android)
        {
            var projectSettings = new SerializedObject(AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/ProjectSettings.asset")[0]);
            var splashImageSetting = projectSettings.FindProperty("androidSplashScreen");
            splashImageSetting.objectReferenceValue = splashImage.texture;
            projectSettings.ApplyModifiedProperties();
        // if (buildTarget == BuildTargetGroup.Android)
        // {
        //     var projectSettings = new SerializedObject(AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/ProjectSettings.asset")[0]);
        //     var splashImageSetting = projectSettings.FindProperty("androidSplashScreen");
        //     splashImageSetting.objectReferenceValue = splashImage.texture;
        //     projectSettings.ApplyModifiedProperties();
            PlayerSettings.Android.splashScreenScale = AndroidSplashScreenScale.ScaleToFill;
        }
        //     PlayerSettings.Android.splashScreenScale = AndroidSplashScreenScale.ScaleToFill;
        // }
    }
    public static void SetCreateRoleAnimation()
Assets/Editor/Tool/UpdateAssetBundleName.cs
@@ -54,7 +54,7 @@
        {
            var importerPath = spriteRelativePath + Path.DirectorySeparatorChar + file.Name;
            var importer = AssetImporter.GetAtPath(importerPath);
            importer.assetBundleName = "sprite/" + file.Name.Split(".")[0].ToLower();
            importer.assetBundleName = "ui/sprite/" + file.Name.Split(".")[0].ToLower();
            // EditorUtility.SetDirty(importer);
        }
@@ -65,7 +65,7 @@
            var pathStringArray = file.DirectoryName.Split(Path.DirectorySeparatorChar);
            var importerPath = spriteRelativePath + Path.DirectorySeparatorChar + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
            var importer = AssetImporter.GetAtPath(importerPath);
            importer.assetBundleName = "sprite/" + pathStringArray[pathStringArray.Length - 1].ToLower();
            importer.assetBundleName = "ui/sprite/" + pathStringArray[pathStringArray.Length - 1].ToLower();
            // EditorUtility.SetDirty(importer);
        }
@@ -95,6 +95,16 @@
            // EditorUtility.SetDirty(importer);
        }
        //战斗预制体
        guids = AssetDatabase.FindAssets("t:prefab", new string[] { "Assets/ResourcesOut/Battle/Prefabs" });
        foreach (var guid in guids)
        {
            var path = AssetDatabase.GUIDToAssetPath(guid);
            var importer = AssetImporter.GetAtPath(path);
            importer.assetBundleName = "ui/battle/prefabs";
            // EditorUtility.SetDirty(importer);
        }
        Debug.Log("Window资源包名更新完成!");
        // AssetDatabase.SaveAssets();
        // AssetDatabase.Refresh();
Assets/Launch/Common/ResourcesPath.cs
@@ -13,8 +13,8 @@
        "standalone";
#endif
    public const string windowFileBundleName = "ui";
    public const string uiprefabFileBundleName = "uicomp";
    public const string windowFileBundleName = "ui/ui";
    public const string uiprefabFileBundleName = "ui/uicomp";
    public readonly static string ResourcesOutPath = Application.dataPath + "/ResourcesOut/";
    public const string ResourcesOutAssetPath = "Assets/ResourcesOut/";