You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now,I am using Jurassic in unity3d。
And I encountered a problem:
C#
private class Transform
{
public int public_value = 789;
public int Add(int i) {
return public_value + i;
}
}
XXXX.CallMemberFunction("Update", new Transform());
javascript
Update: function(transform){
console.log(transform.Add(123));//this line throw exception
}
and throw error: Cannot convert object of type Transform to an object (from TypeConverter)
And I find engine.SetGlobalValue() use "ClrInstanceWrapper" to wrapper it, use So I edit my code:
var trans = new ClrInstanceWrapper(engine, new Transform());
XXXX.CallMemberFunction("Update", trans);
It's run OK.
So my question is:
1、Is there any problem with this?
2、Why SetGlobalValue use ClrInstanceWrapper but CallMemberFunction not use it?
On the other hand, what you're doing should work fine right now (especially for simple cases) and my progress on this project has been pretty glacial lately, so it should work for a while yet.
Now,I am using Jurassic in unity3d。
And I encountered a problem:
C#
javascript
and throw error: Cannot convert object of type Transform to an object (from TypeConverter)
And I find engine.SetGlobalValue() use "ClrInstanceWrapper" to wrapper it, use So I edit my code:
It's run OK.
So my question is:
1、Is there any problem with this?
2、Why SetGlobalValue use ClrInstanceWrapper but CallMemberFunction not use it?
@paulbartrum @Taritsyn @kpreisser
The text was updated successfully, but these errors were encountered: