- Home /
Picking a language...
I am new to unity and have been going through the reference guide and the scripting reference and as many examples as I can find. I am currently noticing that most of the examples in the reference are done in javascript which is really clean and straight forward. One of the things I am noticing is that certain things pop up in C# examples and I have not seen any javascript examples. Some of these include getter/setters (where you can utilize a variable by name not by calling "getVariableName()"), and extending classes. I am wondering if these are included in the javascript implementation and I am not finding reference to them, or if in order to utilize these features I should just make the jump over to C#. Any guidance from more experienced users would be greatly appreciated.
Answer by jonas-echterhoff · Jan 18, 2010 at 10:03 PM
You can extend classes in JavaScript, see the example below. I don't think you can implement getters and setters, though, and there's some other features C# has, which you probably cannot do in JavaScript, like generics or delegate functions.
class MyPlayerEditor extends Editor
{
function OnInspectorGUI()
{
}
}