Hello, I want to transfer my project from .js scripts to c#. I found a website like this…
http://files.m2h.nl//js_to_c.php
does it work? simple “translate” the language and everything runs like on .js? Thank you!
Hello, I want to transfer my project from .js scripts to c#. I found a website like this…
http://files.m2h.nl//js_to_c.php
does it work? simple “translate” the language and everything runs like on .js? Thank you!
Unfortunately, there’s no way for us to tel you whether the site you listed works or not, because we don’t have access to anything they’re doing behind the scenes. However, if it were me, I would not trust a random site I found on the internet to run any kind of scripts.
There are ways to translate between JS and C#, and I’ve collected a couple of them in a post here: http://fragileearthstudios.com/2011/10/18/unity-converting-between-c-and-javascript-2/
If those don’t work for you and you find another good resource, please let me know so I can add it to that list.
You’re in luck because UnityScript to C# is actually very easy
This solution will not work for coroutines because they are very special and can’t be decompiled that easily. Most other things will work pretty well.
_Data/Managed/
Now you have the same classes in C#. There are a lot unnecessary things that the UnityScript compiler has generated, but it won’t hurt. Since you have the scripts as C# you can do some manual optimisations ;).