LSharp
LSharp copied to clipboard
A Pure C# IL Runner,Run DLL as a Script.直接解析执行IL的脚本引擎
例如想打印热更新的dll的名字, 会报错 [Message] public class Entry { public static void Init() { UnityEngine.Debug.Log(typeof(Entry).Assembly.FullName); } } TargetException: Object does not match target type. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[]...
修复了Ldind指令的bug: void test(ref int a) { a++; } 该用例会崩 RefObj.Set会导致原VBox被替换成值,或者引用被替换,造成其他隐性bug 方法return的时候没有回收参数列表的VBox,会造成额外的GC
测试Dll的源码 public class A { public void Test() { byte[] result = new byte[5]{1,1,1,1,1}; for (int i = 0; i < result.Length; i++) { Debug.Log("Before = " + result[i]); result[i]...
现象一: 例如:在一个类里面定了一个事件 class One { public static event System.Action UserLoginEvent; ..... UserLoginEvent+=MyFun; . .... public void MyFun(int beh) { } } 执行到UserLoginEvent+=MyFun;语句,提示UserLoginEvent为空,暴异常。而是用 UserLoginEvent=MyFun;第一次使用就可以。 现象二: 在上面现象一的基础上,在另外一个类里面。 class Two { .... One.UserLoginEvent+=TheOtherFun;...
可以使用Coroutine么,如果可以能给个例子么?
代码: ``` C# /// /// 测试覆盖系统方法 /// public class Test12 { public string Name; public int Age; public override string ToString() { return string.Format("Name:{0}, Age:{1}", Name, Age); } public override...