//两种方式 //1、配置类必须打[Configure]标签 //2、必须放Editor目录 [Configure] public class HelloworldCfg { [IFix] private static IEnumerable<Type> hotfix { get { return new List<Type>() { typeof(Helloworld), typeof(IFix.Test.Calculator), //AnotherClass在Pro Standard Assets下,会编译到Assembly-CSharp-firstpass.dll下,用来演示多dll的修复 typeof(AnotherClass), }; } } [IFix] private static IEnumerable<Type> ToProcess { get { return (from type in Assembly.Load("Assembly-CSharp").GetTypes() where type.Namespace == "XLua" && !type.Name.Contains("<") select type); //对XLua命名空间下进行插入 } } }
public int Add(int a, int b) { return a - b; }
在方法上打上[Patch]标签并修改里面内容
[Patch] public int Add(int a, int b) { return a + b; }
保存之后执行InjectFix/Fix菜单,在项目文件夹中生成.bytes文件
原文:https://www.cnblogs.com/weigangblog/p/14080959.html