Some JavaScript statements don’t seem to apply in Unity–where is a good place to find documentation of general scripting and syntax? Not the Unity-specific stuff like Transform etc., but documentation of conditions, loops, and those kinds of basics.
I want to browse what can be done code-wise before I get in too deep. For instance, this JavaScript using case doesn’t work in Unity, but I imagine Unity can do something similar:
var n = 2; //any value
switch(n)
{
case 1:
//execute code block 1
break;
case 2:
//execute code block 2
break;
default:
//code to be executed if n neither
}
What should I be looking for? Not documentation on JavaScript, which would allow the above. Should I be looking for a Mono beginner’s guide?
Where would a Unity scripting beginner go for reference on the basics?
(I’ve done a lot of scripting over the years, even some JavaScript, but I am sure I could learn a lot from some kind of reference guide–as long as it has info that’s true for Unity.)
I’ve mostly been using the Unity reference to figure out how to code stuff, but when transferring my Java to JavaScript knowledge in the beginning I used regular JavaScript documentation. Some things just don’t work, and I usually just asked about them on this forum to find an answer. For instance, changing an integer to a string is different from in JavaScript. I don’t think there is a way to use switch case syntax with Unity. Perhaps you should look at Mono docs (I’ve never tried that), but most of the syntax is just the same as JavaScript. You should also take a look at Davey JJ’s tutorials if you haven’t already done so (racing and beginning). If you need any one specific problem you can’t find an answer to, work around it for the moment and post your question on this forum. If anyone knows the answer it will be up within the next day or so.