HotReload For Unity的文档的导航的翻译,添加了一些自己的理解。很垃圾

HotReload For Unity的文档的导航的翻译,很垃圾

文档路径:https://hotreload.net/documentation/getting-started
使用的Unity版本:2020,2021,2023
使用的插件版本 1.2.4

Getting Started (开始)

Open Hot Reload
Once Hot Reload is set up and enabled as outlined in the previous instructions, you can access it directly within Unity.
There are two ways to open Hot Reload:
*_Open the Hot Reload window by navigating to "Window" in the Unity menu bar, then selecting "Hot Reload".
*_Use the shortcut key combination Alt+Shift+H to quickly open the Hot Reload window.

Once Hot Reload is open, you will see a button in the bottom right corner of the window with a text saying "Show on Startup". This option allows you to choose whether Hot Reload should automatically open when Unity starts up.

打开热重载
一旦热重载设置和启用在前面的说明中概述,你可以直接在Unity中访问它。
有两种方式打开热加载:

  • _打开热加载窗口导航到“窗口”在Unity菜单栏,然后选择“热加载”。
  • _使用快捷键组合Alt+Shift+H快速打开热加载窗口。
    打开Hot Reload后,你会在窗口的右下角看到一个按钮,上面写着“启动时显示”。这个选项允许你选择在Unity启动时是否应该自动打开Hot Reload。

Downloading Additional Content(下载其他内容)

By default, Hot Reload ships as an extremely lightweight extension. However, in order for Hot Reload to function, it needs to download the Hot Reload server binary for the specific platform and Unity version it is running on. When Hot Reload first starts, it will seamlessly download this server binary and then start Hot Reload. Hot Reload will only download this server binary on startup each time the package is updated to a newer version.

Hot Reload downloads this server binary after install rather than packaging it initially due to the size of the binary. Since the package is compatible with Windows, Linux, and Mac (Intel and Silicon), we need to use a different binary depending on your operating system. Rather than packaging them all in the initial asset and making the total asset size massive, we download only the specific binary needed for your operating system the first time you install. This helps to reduce bandwidth, which gets you started using Hot Reload sooner than if every operating system's binary was included in the initial package.

The Hot Reload server binary contains all the code necessary to Hot Reload code - dotnet, our C# compiler, and our own code used to Hot Reload changes. Without this, users would need to install the exact version of dotnet to compile the code, which is a massive logistical headache and creates a very tricky to install system.

The server binary is downloaded to the following location:` %LocalAppData%/singularitygroup-hotreload/`.

默认情况下,Hot Reload是一个非常轻量级的扩展。然而,为了让Hot Reload发挥作用,它需要下载特定平台的Hot Reload服务器二进制文件和它所运行的Unity版本。当Hot Reload首次启动时,它将无缝下载此服务器二进制文件,然后启动Hot Reload。每次包更新到较新版本时,热重新加载只会在启动时下载该服务器二进制文件。
由于二进制文件的大小,Hot Reload会在安装后下载此服务器二进制文件,而不是在最初将其打包。由于软件包与Windows、Linux和Mac (Intel和Silicon)兼容,我们需要根据您的操作系统使用不同的二进制文件。我们没有将它们全部打包在初始资产中,使总资产大小变得巨大,而是在您第一次安装操作系统时只下载所需的特定二进制文件。这有助于减少带宽,与每个操作系统的二进制文件都包含在初始包中相比,这可以让您更快地开始使用Hot Reload。
Hot Reload服务器二进制文件包含了Hot Reload代码所需的所有代码——dotnet,我们的c#编译器,以及我们自己用于Hot Reload更改的代码。如果没有这个,用户将需要安装准确版本的dotnet来编译代码,这是一个巨大的后勤问题,并且创建了一个非常棘手的安装系统。
服务器二进制文件被下载到以下位置:%LocalAppData%/singularitygroup-hotreload/。

解释

这个插件需要连接网络下载一些dotnet依赖,所以是需要联网的,只要下载一次就可以了。

How does it work? (如何工作)

Hot Reload is a C# compiler extension which only compiles the specific method that changed (which is very fast, taking only milliseconds). After compiling, we swap only that function with the new version.
This also means that there's no domain reload involved, so your static variables stay intact.

Hot Reload是一个c#编译器扩展,它只编译改变的特定方法(非常快,只需要几毫秒)。编译后,只将该函数与新版本的函数交换。
这也意味着不需要重新加载域,因此静态变量保持不变。

解释

是C#拓展,编译非常快。

Unity Auto Refresh

When Hot Reload is active, it automatically disables the "Auto Refresh" setting, which typically triggers domain reload whenever code changes are detected. By temporarily disabling this setting during Hot Reload, developers can immediately see the effects of their code modifications without interruption caused by domain reload.

Moreover, when the Hot Reload server shuts down, the previous "Auto Refresh" setting gets restored. This automated management of the "Auto Refresh" setting guarantees a seamless transition between Hot Reload sessions, enhancing productivity and reducing unnecessary disruptions.

In cases where users prefer to have manual control over the "Auto Refresh" setting, our software provides an option to disable this automatic management. By adjusting the settings, developers can retain their preferred "Auto Refresh" behavior, regardless of the Hot Reload status. This customization option allows for greater flexibility in adapting the development environment to individual preferences and workflows.

You can manually trigger a recompile with CTRL+R, and the editor will determine automatically what needs to be compiled. This manual recompile should be used when making unsupported edits, such as adding a new class. A clear warning will be displayed when you make an unsupported edit.

Do note that after making an unsupported edit, it is often still possible to continue editing unrelated files and functions. The unsupported edit simply will not be visible in the editor until a manual recompile is performed.

当Hot Reload激活时,它会自动禁用“自动刷新”设置,该设置通常会在检测到代码更改时触发域重新加载。通过在热重载期间暂时禁用此设置,开发人员可以立即看到代码修改的效果,而不会因域重载而中断。
此外,当Hot Reload服务器关闭时,将恢复以前的“自动刷新”设置。这种“自动刷新”设置的自动化管理保证了热加载会话之间的无缝过渡,提高了生产力并减少了不必要的中断。
在用户喜欢手动控制“自动刷新”设置的情况下,我们的软件提供了禁用此自动管理的选项。通过调整设置,开发人员可以保留他们喜欢的“自动刷新”行为,而不管热加载状态如何。这种自定义选项允许更大的灵活性,使开发环境适应个人偏好和工作流。
您可以使用CTRL+R手动触发重新编译,编辑器将自动确定需要编译的内容。在进行不受支持的编辑(例如添加新类)时,应使用此手动重新编译。当您进行不支持的编辑时,将显示一个明确的警告。
请注意,在进行了不受支持的编辑之后,通常仍然可以继续编辑不相关的文件和函数。在执行手动重新编译之前,不支持的编辑将在编辑器中不可见。

解释

在修改完代码之后保存Unity会自己重新加载代码,但是这个插件对这个功能进行了修改,由这个插件控制Unity的更新。
使用VS或者VSCode可以不用设置任何东西,使用Rider设置Rider不会自动更新资源
在删除插件的时候需要将Unity的自动刷新开启

Upgrading Hot Reload(更新插件)

When a new version becomes available, the upgrade button will appear at the bottom of the Hot Reload window, which you can use to download and install the latest version.

You can upgrade Hot Reload via the package manager, but we don't recommend it as it can lead to compilation errors. To use the package manager safely, uninstall the package before installing it again with the new version.

当新版本可用时,升级按钮将出现在Hot Reload窗口的底部,您可以使用该按钮下载并安装最新版本。
您可以通过包管理器升级Hot Reload,但我们不建议这样做,因为它可能导致编译错误。要安全地使用包管理器,请在使用新版本重新安装之前卸载该包。

解释

若要更新插件需要在插件的设置面板更新插件,不建议在package manager 中更新插件。

Uninstalling Hot Reload(卸载插件)

Here is what you need to do if you want to completely remove Hot Reload from your project:

    Stop Hot Reload
    Remove Hot Reload with the Package Manager
    Remove Local App Data. Make sure the following folders are removed from your PC:
        remove folder at %LocalAppData%\singularitygroup-hotreload
        remove folder at %LocalAppData%\LicenseSpring\codepatchertrial if it exists
        remove folder at %LocalAppData%\LicenseSpring\codepatcher if it exists
    Remove project specific data folder at <Path-to-unity-project>\Library\com.singularitygroup.hotreload

After you've removed this data, you might want to update your Unity "Auto Refresh" and "Script Changes While Playing" Preferences. See Unity documentation (opens in a new tab) for your specific Unity version.

If you experience issues with your changes not auto refreshing, please consult the troubleshooting section.

下面是你需要做的,如果你想完全从你的项目中删除热加载:
停止热加载
使用包管理器删除热重新加载
删除本地应用数据。确保下列文件夹已从电脑中删除:
删除文件夹%LocalAppData%\singularitygroup-hotreload
删除文件夹%LocalAppData%\ licensesspring \codepatchertrial,如果它存在
删除文件夹%LocalAppData%\ licensesspring \codepatcher,如果它存在
删除项目特定的数据文件夹&lt;Path-to-unity-project&gt;\Library\com.singularitygroup.hotreload
在你删除这些数据后,你可能想要更新你的Unity“自动刷新”和“播放时脚本更改”偏好。查看Unity文档(在新选项卡中打开)以了解特定的Unity版本。
如果您遇到更改未自动刷新的问题,请参阅故障排除部分。

解释

需要删除上面说的文件夹,然后检查IDE的自动刷新设置,检查Unity的自动刷新设置。

其他

就是把文档拷贝一下使用有道翻译翻译一下。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Unity Hot Reload是一款可以在运行时重新加载修改的Unity插件。通过使用这个插件,我们可以在编辑代码时,不需要重新启动Unity就能够直接查看到修改的效果。这样,我们就能够更加高效地进行开发和调试。 要下载Unity Hot Reload插件,首先需要打开Unity官方网站。在官网的Asset Store中搜索"Unity Hot Reload"关键词,然后点击查找按钮。在搜索结果中,找到并点击目标插件。在插件页面中,我们可以看到插件的详细介绍、功能特点、使用方法以及用户评价等信息。 在页面下方,我们可以找到一个"Download"按钮,点击后系统会提示我们登录Unity账号。如果没有账号,需要先注册一个Unity账号。登录完成后,我们可以选择将插件下载到Unity编辑器中。 下载完成后,我们需要在Unity编辑器中导入插件。将下载的Unity Hot Reload插件文件解压缩,然后在Unity项目中导入。导入方法是在Unity编辑器中点击"Assets"菜单栏,选择"Import Package",然后选择"Custom Package"。浏览文件系统中的解压文件夹,选择插件的文件(通常是.unitypackage格式),然后点击"Open"按钮。 导入插件后,Unity Hot Reload插件就可以在Unity编辑器中使用了。我们可以在脚本编辑器中进行代码修改,并实时查看效果。这样,我们就能够更加方便地进行代码的迭代和调试工作。 总之,Unity Hot Reload插件是一款非常实用的工具,可以极大地提高Unity开发的效率。通过以上步骤,我们能够轻松获取到这个插件,并在Unity编辑器中使用它。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值