当前位置: 首页 > news >正文

HotReload for unity支持的代码修改

HotReload for unity支持的代码修改

HotReload的版本:1.2.4
Unity版本:2020,2021,2023
创作日期:2023.10.25

总结一下

  1. 支持在运行的时候修改异步,同步,重命名方法,修改方法参数,返回值,out,ref,访问修饰符,更改任何方法的返回类型,包括实例方法、静态方法、属性、事件、索引器、泛型方法等。
  2. 支持修改字段的任何信息。
  3. 可以修改部分携程中的方法,可以修改Invoke中的方法,可以修改InvokeRepeating 中的方法
  4. 不支持在运行的时候新建变量
  5. 不支持在运行的时候创建新的Class 新的结构
  6. 不支持添加/编辑枚举
  7. 不支持
    添加、编辑、删除字段
    添加新类/结构
    添加、编辑、删除结构的构造函数
    添加/编辑枚举
    编辑泛型类方法
    在部分类型中编辑变量初始化程序
    编辑具有动态返回类型或其中一个参数使用动态的方法体
    添加或删除以下方法关键字之一:partial、abstract、virtual、override、extern
    删除类的构造函数不会删除构造函数的逻辑。作为一种解决方法,考虑保留一个空构造函数而不是删除它,可能在下次进行完全重新编译时删除构造函数。
    已执行的异步方法不会进行修补 - 仅新的调用将使用更新后的逻辑
    支持动态生成的代码,例如Unity Multiplayer hl-api、Photon、Bolt、Mirror等库生成的代码
    添加C#文件
    将更改应用于正在进行的协程。

支持的语法Supported Features

  • Editing functions in monobehaviours, normal classes or static classes
    You can edit the body of the function in any way that is valid C#. We recompile the whole function, so it works the same as you’re already used to.(可以直接修改MonoBehaviours、普通类或静态类中编辑函数中的函数)

  • Editing lambda methods
    If you modify a lambda, we hot-reload the existing lambda. So for example, store a lambda in a static field during startup, and then edit the lambda without running startup code, your change to the lambda will still apply immediately.(可以编辑Lambda 方法)

  • Editing lambda methods with closures
    If you use an outside variable inside your lambda, your lambda will work as usual. If you use a new outside variable, then your lambda will be hot-reloaded only when you create it again. for example the lambda in Array.Sort(() => …) is recreated every time you run the code, so it will always work as expected.(支持闭包的 Lambda 方法的编辑)

  • Editing async/await methods(支持:编辑异步/等待方法)

  • Editing properties (get/set)(编辑属性(get/set))

  • Editing events (add/remove)(编辑事件(add/remove))

  • Editing indexers (square bracket access such as dictionaries)(支持编辑索引器(方括号访问,如字典))

  • Editing operators methods (explicit and implicit operators)(编辑运算符方法(显式和隐式运算符))

  • Editing conversion operators methods such as == and +=(编辑转换运算符方法(如==和+=))

  • Adding/Editing/Removing constructors of classes(加/编辑/删除类的构造函数)

  • Adding/Editing/Removing local functions(添加/编辑/删除本地函数)

  • Changing a method from async to sync, or from sync to async(将方法从异步改为同步,或从同步改为异步)

  • Deleting any methods, properties, fields, class(删除任何方法、属性、字段或类)

  • Adding/editing/removing using directives. E.g. Using UnityEngine(添加/编辑/删除 using 指令(例如:using UnityEngine))

  • Adding/Editing variable initializers. E.g. private int x = 1 in a class
    E.g. int myField = 10. Do note that variables are only initialized when you create a new class instance. We don’t re-run variable initializers for already instantiated classes, as it could break existing code.(添加/编辑变量初始化程序。 例如,类中的私有整数 x = 1。
    例如,整数 myField = 10。请注意,变量仅在创建新类实例时进行初始化。不会为已经实例化的类重新运行变量初始化程序,因为这可能会破坏现有的代码。不可以在运行的时候创建变量)

  • Use of newer C# syntax. Switch expressions, using statements, pattern matching, null coalescing statements, etc. By default, we support all syntax supported by the C# compiler.(支持C#的所有语法)

  • Adding/removing attributes. Note that your code will compile, but System.Reflection won’t pick up on the attribute changes.(添加/移除属性。请注意,您的代码将会编译,但System.Reflection不会捕获属性的更改)

  • Use of nullable anywhere(在任何地方使用可为 null 类型)

  • Adding new methods (添加新方法)

  • Adding, editing, deleting parameters in methods (添加、编辑、删除方法中的参数)

  • Changing the return type of any method. Includes instance, static, properties, events, indexers, generics, etc. (更改任何方法的返回类型,包括实例方法、静态方法、属性、事件、索引器、泛型方法等)

  • Changing accessibility, E.g. changing a method from private to public (更改方法的可访问性,例如,将方法从私有改为公共)

  • Static keyword changes, eg making a method static (更改静态关键字,例如使方法成为静态方法)

  • Renaming methods (重命名方法)

  • Editing generic methods just like normal methods (编辑泛型方法,与普通方法一样)

  • Adding/editing/deleting generic parameters (添加/编辑/删除泛型参数)

  • Adding/editing/deleting the constraint clause of a generic method (E.g. where T : class, new()) (添加/编辑/删除泛型方法的约束子句(例如,where T:class, new()))

  • Adding/replacing/deleting ref, out, in modifiers on arguments (在参数上添加/替换/删除 ref、out、in 修饰符)

  • Editing code marked with [BurstCompile] (编辑带有 [BurstCompile] 标记的代码)

  • Attaching a debugger to modified code in the Unity Editor, including burst compiled code (在Unity编辑器中将调试器附加到已修改的代码,包括 Burst 编译的代码)

  • Attaching a debugger to a Unity Player (On-Device). Supports all code edits just like in the Unity Editor (在Unity Player(设备上)中将调试器附加到已修改的代码,支持与Unity编辑器中一样的代码编辑)

  • Partial coroutine support - changes do apply to newly created coroutines, but ongoing ones won’t update yet (部分协程支持 - 对新创建的协程应用更改,但正在运行的协程尚未更新)

Features on the Roadmap(计划实现)

If you’re using or considering a Business license, and one of these is very important to you, let us know and we’ll prioritize it.

  • Adding, editing, removing fields
  • Adding new classes/structs
  • Adding, editing, removing constructors of structs
  • Adding/editing enums
  • Editing generic class methods
  • Editing variable initializers in partial types
  • Editing a method with return type dynamic, or one of the arguments using dynamic
  • Editing a method body with anonymous types
  • Adding or removing one of the following method keywords: partial, abstract, virtual, override, extern
  • Deleting the constructor of a class doesn’t remove the constructor logic. As a workaround, consider leaving an empty constructor instead of deleting it, and maybe delete the constructor on the next full recompile.
  • Async method that are already executing are not patched - only new invocations will use the updated logic
  • Supporting editing code dynamically generated by libraries like Unity Multiplayer hl-api, Photon, Bolt, Mirror
  • Adding C# files
  • Applying changes to ongoing coroutines

Always Requires a Full Recompile(需要完全编译的东西)

  • Adding, modifying, deleting .asmdef files. Note that scripts inside assembly definitions are supported as you’d expect, only modifications to the .asmdef file itself require a full recompile
  • Modifying define symbols, or other things in .csproj or .sln files

相关文章:

HotReload for unity支持的代码修改

HotReload for unity支持的代码修改 HotReload的版本:1.2.4 Unity版本:2020,2021,2023 创作日期:2023.10.25 总结一下 支持在运行的时候修改异步,同步,重命名方法,修改方法参数,返回值,out,ref&#xff…...

写一个呼吸灯要几行代码?

module breathe( input clk, output reg led ); reg [26:0]cnt 1b0;always (posedge clk) begin cnt < cnt 1b1;if(cnt[15:6]>cnt[25:16])beginled < cnt[26];end else begin led < ~cnt[26];end endendmodule 笔者的clk是50M...

Banana Pi BPI-W3(Armsom W3)RK3588开当板之调试UART

前言 本文主要讲解如何关于RK3588开发板UART的使用和调试方法&#xff0c;包括UART作为普通串口和控制台两种不同使用场景 一. 功能特点 Rockchip UART (Universal Asynchronous Receiver/Transmitter) 基于16550A串口标准&#xff0c;完整模块支持以下功能&#xff1a; 支…...

LeetCode88——合并两个有序数组

LeetCode88——合并两个有序数组 1.题目描述&#xff1a; 给你两个按 非递减顺序 排列的整数数组 nums1 和 nums2&#xff0c;另有两个整数 m 和 n &#xff0c;分别表示 nums1 和 nums2 中的元素数目。 请你 合并 nums2 到 nums1 中&#xff0c;使合并后的数组同样按 非递减…...

C++ BinarySercahTree recursion version

for循环版本的&#xff1a;C BinarySercahTree for version-CSDN博客 Inorder()在c BinarySerschTree for verison写了。 还是按照那种嵌套的方式来写递归。 现在来写查找 FindR() bool FindR(){return _FindR(_root);}然后_FindR()函数写递归具体实现&#xff1a; 假设要…...

兑换码生成与解析-个人笔记(java)

1.需求分析 兑换码长度为10字符&#xff0c;包含24个大写字母和8个数字。兑换码需要保证唯一性&#xff0c;不可重复兑换。需要防止猜测和爆刷攻击。兑换码生成和验证的算法需要高效&#xff0c;避免对数据库带来较大的压力。 导航 1.需求分析2.实现方案3.加密过程4.解密过程5…...

2023/10/25MySQL学习

外键约束 在子表添加外键后,不能在主表删除或更新记录,因为存在外键关联 删除外键,注意外键名称时我们添加外键时起的名称 使用cascade操作后,可以操作主表数据,并且子表的外键也会对应改变 set null的话,删除主表对应主键信息后,子表对应外键信息变为空 多表关系 创建中间表 可…...

网络协议--Ping程序

7.1 引言 “ping”这个名字源于声纳定位操作。Ping程序由Mike Muuss编写&#xff0c;目的是为了测试另一台主机是否可达。该程序发送一份ICMP回显请求报文给主机&#xff0c;并等待返回ICMP回显应答&#xff08;图6-3列出了所有的ICMP报文类型&#xff09;。 一般来说&#x…...

如何在 Azure 容器应用程序上部署具有 Elastic Observability 的 Hello World Web 应用程序

作者&#xff1a;Jonathan Simon Elastic Observability 是提供对正在运行的 Web 应用程序的可见性的最佳工具。 Microsoft Azure 容器应用程序是一个完全托管的环境&#xff0c;使你能够在无服务器平台上运行容器化应用程序&#xff0c;以便你的应用程序可以扩展和缩减。 这使…...

JAVA排序

再看各种排序前我们先了解一下什么叫 稳定性 比如一组数据arr[i]下标与arr[j下标]相等,arr[i]在前面,arr[j]在arr[i]后面,排序后这两个数据仍然是arr[i]在arr[j]前面,arr[j]在arr[i]后面,这就叫稳定 插入排序&#xff1a; 优势: 越有序查找速度越快 时间复杂度: O(N^2) 空间复…...

opencalib中lidar2camera安装记录

目录 一、opencalib安装 二、lidar2camera的安装 三、测试运行 四、出现过的问题 一、opencalib安装 代码地址&#xff1a;https://github.com/PJLab-ADG/SensorsCalibration/blob/master/README.md # pull docker image sudo docker pull scllovewkf/opencalib:v1 # Aft…...

整个自动驾驶小车001:概述

材料&#xff1a; 1&#xff0c;树梅派4b&#xff0c;作为主控&#xff0c;这个东西有linux系统&#xff0c;方便 2&#xff0c;HC-S104超声波模块&#xff0c;我有多个&#xff0c;不少于4个&#xff0c;我可以前后左右四个方向都搞一个 3&#xff0c;l298n模块&#xff0c;…...

windows本地搭建mmlspark分布式机器平台流程

文章目录 windows本地搭建mmlspark分布式机器平台流程安装环境pyspark环境spark环境java环境hadoop环境1.修改hadoop配置文件下的jdk地址为自己的实际地址2.修改bin文件离线环境jar包环境1mmlsprk第三方包jar包环境2参考代码我有话说其他问题记录概要参考文献windows本地搭建mm…...

深入探究 Next.js 中的 getServerSideProps 和 getStaticProps 用法及区别

引言&#xff1a; Next.js 是一个流行的 React 框架&#xff0c;它提供了许多强大的功能来简化服务器渲染&#xff08;SSR&#xff09;和静态生成&#xff08;SSG&#xff09;的过程。其中&#xff0c;getServerSideProps 和 getStaticProps 是两个重要的函数&#xff0c;用于在…...

餐饮业如何高效经营?赶紧闭眼抄这个方法!

在现代社会&#xff0c;餐饮业已经成为人们日常生活中不可或缺的一部分。为了提高食堂运营效率&#xff0c;满足不断增长的客户需求&#xff0c;智慧收银系统应运而生。 智慧收银系统帮助食堂业主更好地理解其客户&#xff0c;提高服务质量&#xff0c;优化库存管理&#xff0c…...

餐饮外卖小程序商城的作用是什么

随着互联网及线上餐饮的发展趋势&#xff0c;行业洗牌正在加速&#xff0c;并且对餐饮连锁门店提出更高要求&#xff0c;餐饮数字化转型加快&#xff0c;积极发展线上经营是不少餐饮商家的首选。这其中&#xff0c;餐饮外卖商城成为很多餐饮品牌的线上经营品牌&#xff0c;也是…...

nRF52832 SDK15.3.0 基于ble_app_uart demo FreeRTOS移植

参考资料&#xff1a;Nrf52832 freeOS系统移植_nrf5283操作系统-CSDN博客 这里把移植经验记录下来&#xff0c;供有需要的同学参考&#xff0c;有不对的地方也请大家批评指正。 把FreeRTOS移植到 nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart工程&#xff…...

电厂数据可视化三维大屏展示平台加强企业安全防范

园区可视化大屏是一种新型的信息化手段&#xff0c;能够将园区内各项数据信息以图像的形式直观呈现在大屏幕上&#xff0c;便于管理员和员工进行实时监控、分析和决策。本文将从以下几个方面介绍园区可视化大屏的作用和应用。 VR数字孪生园区系统是通过将实际园区的各种数据和信…...

2246: 【区赛】【宁波32届小学生】最佳交换

目录 题目描述 输入 输出 样例输入 样例输出 提示 代码 题目描述 星星小朋友和 N-1 个小伙伴一起玩了一上午的纸牌游戏&#xff0c;星星总是能赢&#xff0c;气焰嚣张&#xff0c; 小伙伴们决定出道纸牌问题难倒星星&#xff0c;让他别再狂妄自大了&#xff0c;问题是这…...

Java面试记录

文章目录 1、final关键字2、synchronized关键字&#xff08;1&#xff09;synchronized的功能&#xff1a;&#xff08;2&#xff09;synchronized的底层实现原理&#xff1a; 3、Java中线程同步的实现方法&#xff08;1&#xff09;. 使用synchronized关键字&#xff1a;&…...

Linux 文件类型,目录与路径,文件与目录管理

文件类型 后面的字符表示文件类型标志 普通文件&#xff1a;-&#xff08;纯文本文件&#xff0c;二进制文件&#xff0c;数据格式文件&#xff09; 如文本文件、图片、程序文件等。 目录文件&#xff1a;d&#xff08;directory&#xff09; 用来存放其他文件或子目录。 设备…...

智慧医疗能源事业线深度画像分析(上)

引言 医疗行业作为现代社会的关键基础设施,其能源消耗与环境影响正日益受到关注。随着全球"双碳"目标的推进和可持续发展理念的深入,智慧医疗能源事业线应运而生,致力于通过创新技术与管理方案,重构医疗领域的能源使用模式。这一事业线融合了能源管理、可持续发…...

Cloudflare 从 Nginx 到 Pingora:性能、效率与安全的全面升级

在互联网的快速发展中&#xff0c;高性能、高效率和高安全性的网络服务成为了各大互联网基础设施提供商的核心追求。Cloudflare 作为全球领先的互联网安全和基础设施公司&#xff0c;近期做出了一个重大技术决策&#xff1a;弃用长期使用的 Nginx&#xff0c;转而采用其内部开发…...

C++.OpenGL (10/64)基础光照(Basic Lighting)

基础光照(Basic Lighting) 冯氏光照模型(Phong Lighting Model) #mermaid-svg-GLdskXwWINxNGHso {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-GLdskXwWINxNGHso .error-icon{fill:#552222;}#mermaid-svg-GLd…...

土地利用/土地覆盖遥感解译与基于CLUE模型未来变化情景预测;从基础到高级,涵盖ArcGIS数据处理、ENVI遥感解译与CLUE模型情景模拟等

&#x1f50d; 土地利用/土地覆盖数据是生态、环境和气象等诸多领域模型的关键输入参数。通过遥感影像解译技术&#xff0c;可以精准获取历史或当前任何一个区域的土地利用/土地覆盖情况。这些数据不仅能够用于评估区域生态环境的变化趋势&#xff0c;还能有效评价重大生态工程…...

NLP学习路线图(二十三):长短期记忆网络(LSTM)

在自然语言处理(NLP)领域,我们时刻面临着处理序列数据的核心挑战。无论是理解句子的结构、分析文本的情感,还是实现语言的翻译,都需要模型能够捕捉词语之间依时序产生的复杂依赖关系。传统的神经网络结构在处理这种序列依赖时显得力不从心,而循环神经网络(RNN) 曾被视为…...

【Nginx】使用 Nginx+Lua 实现基于 IP 的访问频率限制

使用 NginxLua 实现基于 IP 的访问频率限制 在高并发场景下&#xff0c;限制某个 IP 的访问频率是非常重要的&#xff0c;可以有效防止恶意攻击或错误配置导致的服务宕机。以下是一个详细的实现方案&#xff0c;使用 Nginx 和 Lua 脚本结合 Redis 来实现基于 IP 的访问频率限制…...

解决:Android studio 编译后报错\app\src\main\cpp\CMakeLists.txt‘ to exist

现象&#xff1a; android studio报错&#xff1a; [CXX1409] D:\GitLab\xxxxx\app.cxx\Debug\3f3w4y1i\arm64-v8a\android_gradle_build.json : expected buildFiles file ‘D:\GitLab\xxxxx\app\src\main\cpp\CMakeLists.txt’ to exist 解决&#xff1a; 不要动CMakeLists.…...

PydanticAI快速入门示例

参考链接&#xff1a;https://ai.pydantic.dev/#why-use-pydanticai 示例代码 from pydantic_ai import Agent from pydantic_ai.models.openai import OpenAIModel from pydantic_ai.providers.openai import OpenAIProvider# 配置使用阿里云通义千问模型 model OpenAIMode…...

虚拟机网络不通的问题(这里以win10的问题为主,模式NAT)

当我们网关配置好了&#xff0c;DNS也配置好了&#xff0c;最后在虚拟机里还是无法访问百度的网址。 第一种情况&#xff1a; 我们先考虑一下&#xff0c;网关的IP是否和虚拟机编辑器里的IP一样不&#xff0c;如果不一样需要更改一下&#xff0c;因为我们访问百度需要从物理机…...