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

Feature Request: Unity3d support #35

Open
Nanonid opened this issue Jun 14, 2016 · 9 comments
Open

Feature Request: Unity3d support #35

Nanonid opened this issue Jun 14, 2016 · 9 comments

Comments

@Nanonid
Copy link

Nanonid commented Jun 14, 2016

I'm still diagnosing the issue but Jurrasic from asset store and from github both crash Unity3d.
Somewhere in the IL code generation.
I'm using Unity 5.4.0b20 (64-bit).

It's a pain, but the -unsafe and mono .net 2.0 is very limiting in JS choices.

Thanks.

@tolstenko
Copy link

You could generate the DLL from js using the function SaveDLL, and then import it. The problem is that the dll generated depends on the jurassic.dll and it has emit. It may be possible to generate a jurassic dll without the unsupported functions so it can be imported by unity and run the dll generated js code.
Am I right?

@paulbartrum
Copy link
Owner

I haven't tested on Mono. I may do that at some point, but in the meantime, have you considered using Jint instead?

@DAVco4
Copy link

DAVco4 commented Jun 18, 2016

I'm using Untiy 5.3.5f1 (latest stable) and Jurassic compiled for .NET Framework 3.5 with no issues. My IDE is VS2010, but I'm pretty sure that Unity compiles all it's code via Mono anyway.

This may be an issue with Unity 5.4?

@tolstenko
Copy link

tolstenko commented Jun 20, 2016

@paulbartrum thanks for your suggestion. They use the keyword dynamic, which is currently unsupported by unity :/

The saved DLL depends on jurassic DLL, and jurassic uses emit which is unsupported on IL2CPP platforms such as iOS and WebGL. In order to use the saved DLL you must remove the jurassic dependency and/or stripe down all emit code from the jurassic.

This text describes the problem: https://developer.xamarin.com/guides/ios/advanced_topics/limitations/#No_Dynamic_Code_Generation

System.Reflection.Emit
The lack of System.Reflection. Emit means that no code that depends on runtime code generation will work. This includes things like:

The Dynamic Language Runtime.
Any languages built on top of the Dynamic Language Runtime.
Remoting's TransparentProxy or anything else that would cause the runtime to generate code dynamically.

Important: Do not confuse Reflection.Emit with Reflection. Reflection.Emit is about generating code dynamically and have that code JITed and compiled to native code. Due to the limitations on the iPhone (no JIT compilation) this is not supported.
But the entire Reflection API, including Type.GetType ("someClass"), listing methods, listing properties, fetching attributes and values works just fine.

@Jayatubi
Copy link

Jayatubi commented Sep 2, 2016

@DAVco4 How do you fix the compile issue when targeting .NET 3.5? I got an issue while the Jurassic using ConditionalWeakTable which was introduced in .NET 4.0

@tolstenko
Copy link

Unity announced that will support new mono compilers and new features -> http://forum.unity3d.com/threads/yes-unity-5-5-new-compiler-and-gc.408313/
But it targets only to 3.5. They need to modify lots of unity internal code to make 4.0 target working. You can check a almost stable build here: http://forum.unity3d.com/threads/upgraded-c-compiler-on-5-3-5p8.417363/
They have said the version 5.5 will address this compiler issue. I am waiting for it.

@yosun
Copy link

yosun commented Oct 29, 2017

any update?

@andywatts
Copy link

Any tips on building this for unity?

@yosun
Copy link

yosun commented Jul 2, 2018

pokes

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

No branches or pull requests

7 participants