Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何自行替换汉化bundle文件 #69

Closed
MiddleRed opened this issue Jul 26, 2022 · 0 comments
Closed

如何自行替换汉化bundle文件 #69

MiddleRed opened this issue Jul 26, 2022 · 0 comments

Comments

@MiddleRed
Copy link
Collaborator

MiddleRed commented Jul 26, 2022

转载自QQ频道
此过程需要耗费大量精力,如需帮助请加discord或者qq频道询问,在此issue下回复我们无法保证能及时回复你的消息。
6e6c00f40ce1ae01276e50492f4aa2fd
首先具有相同路径的资源会替换掉原本的资源

9ed67b71c7381e7a60a552781f36a1df
extraAssetBundlePath下的这个assetbundle作为替换的来源

需要启用replaceAssets(本插件功能)

然后是打包assetbundle的方法
738449f714f5c7d5403fac75e6950c1c
首先打开unity
d7429af46dd27d6786c366165b434741

推荐使用这个版本,也就是赛马娘现在正在使用的版本

然后把资源放在对应的资源路径下,指定右下角的assetbundle
2039e18bcdb8351c4f4157457fd7a462
最初是没有这个的,需要New...输入名称,之后打包的assetbundle会是这个名称,不影响实际的资源路径

然后新建一个txt,写入以下代码

using UnityEngine;
using UnityEditor;
using System.IO;

public class CreateAssetBundle
{
    [MenuItem("Assets/Build AssetBundle")]
    static void BuildAssetBundle()
    {
        var assetBundleDirectory = "Assets/StreamingAssets";
        if (!Directory.Exists(assetBundleDirectory))
        {
            Directory.CreateDirectory(assetBundleDirectory);
        }
        BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget);
    }
}

保存并重命名为CreateAssetBundle.cs,把这个文件放在Assets/Editor下(Unity项目)

5f1100dde5bb2c1fda6a575fa0cdc428
之后Assets菜单会多一个Build AssetBundle

配置好所有资源关联的AssetBundle之后,点这个会输出到Assets/StreamingAssets目录下

这样就打包完成了

然后replaceFont只要config.json指定一下路径就好了

如果只需要替换字体,则直接把自行打包的bundle文件替换原先下载下来的umamusumelocalify就行
如果需要原先bundle文件中的贴图,你可以先用AssetStudio把umamusumelocalify内的资源全部导出出来,然后把其中的字体文件替换掉,再用Unity打包。打包时需要注意资源路径要与原来umamusumelocalify中的资源路径一致

@chinosk6 chinosk6 pinned this issue Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant