|
Hi! I've a problem with a C#script that i'm trying to convert to javascript. But i've no idea of C# sintax. Can somone convert this for me? Thanks in advance
(comments are locked)
|
|
You most likely aren't going to get people here who are going to spend their time converting your script. Become a better Unity developer and learn to code in both languages. Trust me, down the line you'll need to be able to do both if you want to become successful with Unity. Take a look at this thread for a good read on the syntax differences. Ya I had noticed, but I posted my answer not knowing that you had answered the question and didn't feel like deleting mine
Jun 03 '11 at 06:38 PM
Peter G
(comments are locked)
|
|
First, the code you posted is full of errors if it is C#. Another error: But besides for that there isn't really anything that should cause problems in translating that aren't obvious changes. Identify variables and declare them in js syntax. The only thing to remember is that casting in js can only be done with And see this answer for a more in-depth explanation. http://answers.unity3d.com/questions/12911/what-are-the-syntax-differences-in-c-and-javascrip.html thats the link I gave him :p
Jun 03 '11 at 06:35 PM
Meltdown
(comments are locked)
|
|
Thanks Meltdown en peter! While you'r answering my question, i've tried to convert only the changes i need to c#. So thank's again, and sorry to ask you that things but i'm learning animation, 3d design, texturing and javascript. If i have to learn C# too, my head will explode for sure. Cheers!
(comments are locked)
|
