Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

官方的例子,继承适配器这里,获取属性的时候会报错,大哥们有遇到么 #9

Open
justinlm opened this issue Aug 12, 2020 · 1 comment

Comments

@justinlm
Copy link

justinlm commented Aug 12, 2020

运行继承适配器例子,InheritanceAdapter 的 public override System.Int32 Value 属性方法里面会报错。

NullReferenceException: Object reference not set to an instance of an object ILRuntime.CLR.TypeSystem.CLRType.GetMethod (System.String name, System.Collections.Generic.List1[T] param, ILRuntime.CLR.TypeSystem.IType[] genericArguments, ILRuntime.CLR.TypeSystem.IType returnType, System.Boolean declaredOnly) (at Library/PackageCache/com.ourpalm.ilruntime@1.6.3/CLR/TypeSystem/CLRType.cs:705)
ILRuntime.Runtime.Enviorment.CrossBindingAdaptor.GetMethod (System.String name, System.Collections.Generic.List1[T] param, ILRuntime.CLR.TypeSystem.IType[] genericArguments, ILRuntime.CLR.TypeSystem.IType returnType, System.Boolean declaredOnly) (at Library/PackageCache/com.ourpalm.ilruntime@1.6.3/Runtime/Enviorment/CrossBindingAdaptor.cs:52) ILRuntime.Runtime.Enviorment.CrossBindingMethodInfo.EnsureMethod (ILRuntime.Runtime.Intepreter.ILTypeInstance ins) (at Library/PackageCache/com.ourpalm.ilruntime@1.6.3/Runtime/Enviorment/CrossBindingMethodInfo.cs:729) ILRuntime.Runtime.Enviorment.CrossBindingMethodInfo.CheckShouldInvokeBase (ILRuntime.Runtime.Intepreter.ILTypeInstance ins) (at Library/PackageCache/com.ourpalm.ilruntime@1.6.3/Runtime/Enviorment/CrossBindingMethodInfo.cs:699) ILRuntimeDemo.TestClassBaseAdapter+Adapter.get_Value () (at Assets/Samples/ILRuntime/1.6.3/Demo/Scripts/Examples/04_Inheritance/InheritanceAdapter.cs:70) Inheritance.OnHotFixLoaded () (at Assets/Samples/ILRuntime/1.6.3/Demo/Scripts/Examples/04_Inheritance/Inheritance.cs:117) Inheritance+<LoadHotFixAssembly>d__4.MoveNext () (at Assets/Samples/ILRuntime/1.6.3/Demo/Scripts/Examples/04_Inheritance/Inheritance.cs:92) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at D:/unity/Runtime/Export/Coroutines.cs:17)

@SirLpc
Copy link

SirLpc commented Aug 26, 2020

同样,0参数的虚方法也是这样
NullReferenceException: Object reference not set to an instance of an object
ILRuntime.CLR.TypeSystem.CLRType.GetMethod (System.String name, System.Collections.Generic.List1[T] param, ILRuntime.CLR.TypeSystem.IType[] genericArguments, ILRuntime.CLR.TypeSystem.IType returnType, System.Boolean declaredOnly) (at Library/PackageCache/com.ourpalm.ilruntime@1.6.3/CLR/TypeSystem/CLRType.cs:705) ILRuntime.Runtime.Enviorment.CrossBindingAdaptor.GetMethod (System.String name, System.Collections.Generic.List1[T] param, ILRuntime.CLR.TypeSystem.IType[] genericArguments, ILRuntime.CLR.TypeSystem.IType returnType, System.Boolean declaredOnly) (at Library/PackageCache/com.ourpalm.ilruntime@1.6.3/Runtime/Enviorment/CrossBindingAdaptor.cs:52)
ILRuntime.Runtime.Enviorment.CrossBindingMethodInfo.EnsureMethod (ILRuntime.Runtime.Intepreter.ILTypeInstance ins) (at Library/PackageCache/com.ourpalm.ilruntime@1.6.3/Runtime/Enviorment/CrossBindingMethodInfo.cs:729)
ILRuntime.Runtime.Enviorment.CrossBindingMethodInfo.CheckShouldInvokeBase (ILRuntime.Runtime.Intepreter.ILTypeInstance ins) (at Library/PackageCache/com.ourpalm.ilruntime@1.6.3/Runtime/Enviorment/CrossBindingMethodInfo.cs:699)
ILRuntimeDemo.TestClassBaseAdapter+Adapter.TestVirtual () (at Assets/Samples/ILRuntime/1.6.3/Demo/Scripts/Examples/04_Inheritance/InheritanceAdapter.cs:55)
Inheritance.OnHotFixLoaded () (at Assets/Samples/ILRuntime/1.6.3/Demo/Scripts/Examples/04_Inheritance/Inheritance.cs:114)
Inheritance+d__4.MoveNext () (at Assets/Samples/ILRuntime/1.6.3/Demo/Scripts/Examples/04_Inheritance/Inheritance.cs:92)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants