📜 ⬆️ ⬇️

Unity - choose javascript editor

So we want to write a toy on Unity. Unity gives us a choice of three scripting languages ​​- Javascript, C # and Boo.

Because I didn’t want to deal with Boo at all, then for us there was a choice of JS vs C #. JavaScript was more suitable for our purposes (in fact, it would be more correct to call it UnityScript), since it has a softer typing, and it would be much easier to translate the code that we have from Flash ActionScript.

But we ran into a problem that we did not expect to detect at all.
')
You won’t believe it, but for Unity there is no normal JavaScript editor (this is about developing for Windows, although for Mac the situation, as I understood it, is no better).

A list of editors can be viewed in the unofficial wiki .

So what do I want from the editor?

Of course, I want a smart and advanced auto-complete (intellisence).

We will test the editor on the following code:

Separately, we create a test class TestClass.js:
public class TestClass {

public static var var_stat: int ;
public var var_pub: int ;
public static function TestFunc (): void {}

}


Now we will create a second class, on which we will test auto-complete:
public class TestClass2 {

public var var_pub: int ;
protected var var_prot: int ;
private var var_priv: int ;

public static function StatFunc (): void {}

private function PrivFunc (): void {}

public function get var_getter (): int { return var_priv; }

public function DoTest () {

var var_int: int ;
// here we will test auto-complete

}

}

We will write the code in a place marked with comments and we will want to see autocomplete.

Editors I found 3 pieces:
  1. MonoDevelop shipped with Unity
  2. UniScript Editor ( here )
  3. UnityDevelop (modified FlashDevelop of the old version + classes for unity 3.5 - here )

In the plate below, I will mark the situations where the autocomplete has coped with the plus signs.
auto-complete / functionalityMonoDevelopUniScript EditorUnityDevelop
Testc lass+-+
Testc lass2--+
TestClass. Testfunc--+
TestClass2. StatFunc+-+
var_ int+++
var_ pub+++
var_ prot-++
var_ priv-++
var_ getter--+
this. Privfunc--+
Rand om+++
Random. Range+++
Random.Range ( general parameters hint++± (help only with
function selection)

Random.Range ( hint on the parameters depending on the parameter+
--
Instanti ate-+-
Instantiate ( parameters hint-+-
var go: GameObj ect-++
variable hover information-++
hover function info--+
ctrl + click (go to function / variable definition)--± (F4)
class treeonly current class
breaks on getters
(stops showing
something)

only variables
only current class

all perfectly


And what do we see? In principle, UnityDevelop looks the best. But the inconvenient help on functions spoils everything. Perhaps, if someone adapted a fresh FlashDevelop for Unity, everything would be fine. But no one did this (now UnityDevelop is built on FD 0.9).

And no editor supports Ctrl + Click.

Conclusion? I do not know ... To write on sharps in VS?

In general, I am surprised that Unity is so reckless with its editor. Still, the product is not cheap ($ 1500 for the pro version + another $ 3000 for the pro version for iOS / Android). Could do something more sane. For example, to tie to the same Eclipse, as Adobe did with its Flash Builder (which, in fact, is Eclipse).

If someone has experience - welcome in the comments, I will listen with pleasure.

UPDATE : After all this, I spat and he contributed to the emergence of Unity Develop 4 (details and download links in this topic ).

Source: https://habr.com/ru/post/141183/


All Articles