广东省建设厅网站6,wordpress大访问量,网站的系统建设方式有哪些方面,手机网站建设价位官方文档开始学习,快速上手 | HybridCLR (code-philosophy.com)是官方文档链接
1.建议使用2019.4.40、2020.3.26、 2021.3.0、2022.3.0 中任一版本至于其他2019-2022LTS版本可能出现打包失败情况 2.
Windows Win下需要安装visual studio 2019或更高版本。安装时至少要包含 使…官方文档开始学习,快速上手 | HybridCLR (code-philosophy.com)是官方文档链接
1.建议使用2019.4.40、2020.3.26、 2021.3.0、2022.3.0 中任一版本至于其他2019-2022LTS版本可能出现打包失败情况 2.
Windows Win下需要安装visual studio 2019或更高版本。安装时至少要包含 使用Unity的游戏开发 和 使用c的游戏开发 组件。安装git Git - 下载包 (git-scm.com) 官网下载git vs添加组件选择这两个 3.安装 com.code-philosophy.hybridclr 包
主菜单中点击Windows/Package Manager打开包管理器。如下图所示点击Add package from git URL...填入https://gitee.com/focus-creative-games/hybridclr_unity.git或https://github.com/focus-creative-games/hybridclr_unity.git 初始化 com.code-philosophy.hybridclr
打开菜单HybridCLR/Installer... 点击安装按钮进行安装。 耐心等待30s左右安装完成后会在最后打印 安装成功日志。 4.创建脚本 ConsoleToScreen public class ConsoleToScreen : MonoBehaviour { const int maxLines 50; const int maxLineLength 120; private string _logStr ; private readonly Liststring _lines new Liststring(); public int fontSize 15; void OnEnable() { Application.logMessageReceived Log; } void OnDisable() { Application.logMessageReceived - Log; } public void Log(string logString, string stackTrace, LogType type) { foreach (var line in logString.Split(\n)) { if (line.Length maxLineLength) { _lines.Add(line); continue; } var lineCount line.Length / maxLineLength 1; for (int i 0; i lineCount; i) { if ((i 1) * maxLineLength line.Length) { _lines.Add(line.Substring(i * maxLineLength, maxLineLength)); } else { _lines.Add(line.Substring(i * maxLineLength, line.Length - i * maxLineLength)); } } } if (_lines.Count maxLines) { _lines.RemoveRange(0, _lines.Count - maxLines); } _logStr string.Join(\n, _lines); } void OnGUI() { GUI.matrix Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(Screen.width / 1200.0f, Screen.height / 800.0f, 1.0f)); GUI.Label(new Rect(10, 10, 800, 370), _logStr, new GUIStyle() { fontSize Math.Max(10, fontSize) }); } }5.
场景中创建一个空GameObject将ConsoleToScreen挂到上面
在Build Settings中添加main场景到打包场景列表
创建 Assets/HotUpdate 目录在目录下
右键 Create/Assembly Definition创建一个名为HotUpdate的程序集模块
6. 7.
创建LoadDll.cs脚本 挂载到场景中 运行 屏幕上出现Hello, HybridCLR 8.
运行菜单 HybridCLR/Generate/All 进行必要的生成操作。 将{proj}/HybridCLRData/HotUpdateDlls/StandaloneWindows64(MacOS下为StandaloneMacXxx)目录下的HotUpdate.dll复制到Assets/StreamingAssets/HotUpdate.dll.bytes注意要加.bytes后缀 复制到StreamingAssets里加.bytes 打开Build Settings对话框点击Build And Run打包并且运行热更新示例工程。
如果打包成功并且屏幕上显示 Hello,HybridCLR表示热更新代码被顺利执行 测试热更新
修改Assets/HotUpdate/Hello.cs的Run函数中Debug.Log(Hello, HybridCLR);代码改成Debug.Log(Hello, World);。运行菜单命令HybridCLR/CompileDll/ActiveBulidTarget重新编译热更新代码。将{proj}/HybridCLRData/HotUpdateDlls/StandaloneWindows64(MacOS下为StandaloneMacXxx)目录下的HotUpdate.dll复制为刚才的打包输出目录的 XXX_Data/StreamingAssets/HotUpdate.dll.bytes。复制过来记得名字保持一致重新运行程序会发现屏幕中显示Hello, World表示热更新代码生效了
至此完成热更新体验