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
I am using Jurassic in Unity3d and can't edit unity source code.
and I want to use generic method such as "List"、"Dictionary"。
So I edit Jurassic code in Jurassic.Compiler.BinderUtilities.ResolveOverloads():
// Get methods from the handles.
var methods = new BinderMethod[methodHandles.Length];
for (int i = 0; i < methodHandles.Length; i++)
{
//add by hzy support generic class
if(thisValue is ClrInstanceWrapper)
{
if((thisValue as ClrInstanceWrapper).WrappedInstance.GetType().IsGenericType)
{
methods[i] = new BinderMethod(MethodBase.GetMethodFromHandle(methodHandles[i],
(thisValue as ClrInstanceWrapper).WrappedInstance.GetType().TypeHandle));
}
else
{
methods[i] = new BinderMethod(MethodBase.GetMethodFromHandle(methodHandles[i]));
}
}
else if(thisValue is ClrStaticTypeWrapper)
{
if((thisValue as ClrStaticTypeWrapper).WrappedType.IsGenericType)
{
methods[i] = new BinderMethod(MethodBase.GetMethodFromHandle(methodHandles[i],
(thisValue as ClrStaticTypeWrapper).WrappedType.TypeHandle));
}
else
{
methods[i] = new BinderMethod(MethodBase.GetMethodFromHandle(methodHandles[i]));
}
}
else
{
methods[i] = new BinderMethod(MethodBase.GetMethodFromHandle(methodHandles[i]));
}
}
It's work well。
Does this make any mistakes?
And I also want to extend unity inner class, such as
public static int Add100(this Transform input)
{
return input.public_value + 100;
}
I edit Jurassic source code, In win32 process I success, but int unity3d I failed. the extended function can not access in javascript.
I am using Jurassic in Unity3d and can't edit unity source code.
and I want to use generic method such as "List"、"Dictionary"。
So I edit Jurassic code in Jurassic.Compiler.BinderUtilities.ResolveOverloads():
It's work well。
Does this make any mistakes?
And I also want to extend unity inner class, such as
I edit Jurassic source code, In win32 process I success, but int unity3d I failed. the extended function can not access in javascript.
Do you have any advice?
@paulbartrum
The text was updated successfully, but these errors were encountered: