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

List<T> add错误 #20

Closed
qn9663 opened this issue Nov 9, 2020 · 8 comments
Closed

List<T> add错误 #20

qn9663 opened this issue Nov 9, 2020 · 8 comments

Comments

@qn9663
Copy link

qn9663 commented Nov 9, 2020

使用 class A : JBehavior, IMyInterface ,B : MyClass,IMyInterface 时候
`List<\IMyInterface > list = new List<\IMyInterface >();

list.Add(a);//error

list.Add(b);

IL_0053: callvirt System.Void System.Collections.Generic.List1<>::Add(!0)

应该是用了适配器引起的继承关系问题.

@JasonXuDeveloper
Copy link
Owner

class a继承了JBehaviour,请使用JBehaviour.Get方法获取

@JasonXuDeveloper
Copy link
Owner

不要用获取monobehaviour的方法去获取JBehaviour,能获取但不能强转到别的类,因为mono适配器的问题,所以需要JBehaviour提供的方法去get,就可以进行类型转换了

@JasonXuDeveloper
Copy link
Owner

代码可以使用```来显示,
例如:

代码在这里

@JasonXuDeveloper
Copy link
Owner

三个“`”开头,然后c#,换行,写代码,最后三个结尾

@JasonXuDeveloper
Copy link
Owner

问题已定位,等修复,今晚。

@JasonXuDeveloper
Copy link
Owner

无法解决,ILRuntime作者回应,不能用纯热更内的接口去存跨域的对象,你得在热更里创一个对象,然后复制跨域对象的值,然后再加入字典,这样一来,是可以加入和读取的,但是更改的话无法同步,需要你自己去实现
iShot2020-11-09 17 55 07

@JasonXuDeveloper
Copy link
Owner

很抱歉哈,刚刚又和ILRuntime作者探讨了一下,这个问题已经解决,明天会在development分支提交这个修复。
iShot2020-11-09 22 36 57

iShot2020-11-09 22 37 49

iShot2020-11-09 22 37 45

@JasonXuDeveloper
Copy link
Owner

bug 已修复,3分支都解决了,参考使用ConverDemo即可

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