3 ms·
Unity used to have a JS interface, where one could either write their game object components in JS or C#. They deprecated the JS interface. I imagine it was to
by sovietmudkipz 4y ago
Unity used to have a JS interface, where one could either write their game object components in JS or C#. They deprecated the JS interface.
I imagine it was too much work to support two languages? As a dev reading docs, I used to have to deconflict the parts of the docs talking about JS from C# (not difficult as an experienced dev -- I wonder how the first timers fared). I'd also have to translate advice from JS Unity programmers into C# when researching how to do certain game things. I'm sure JS Unity devs had to do the same with C# advice.
I'm happy they aligned on one language. If JS had an optional type system baked into the language, I think it would be a better choice. However; it doesn't.
- wccrawford 4y agoI think it was more that Unity's "JS" was actually their own language that was just very similar to real Javascript. They were forced to support the language itself as well as the integration. It was a lot easier to just support C#, which is maintained by others.
- llanowarelves 4y agoHmm. Cocos Creator manages JavaScript/TypeScript ontop of their bespoke (ios:Obj-C++, Android: Java) + C++ native stack and they don't have that many engineering resources. Granted, they did have multiple breaking non-backwards compatible re-architecturings of their engine(s), along the way.
- kevingadd 4y agoCocos is likely using actual JavaScript. When I used Unity's JS dialect (a very long time ago, to be fair) it was very much not traditional JS and was its own beast, so Unity likely was having to do a lot of work on it.
- debugnik 4y agoUnityScript wasn't actually JavaScript, but a custom .NET language with a JS-like syntax, largely incompatible of course. Naturally people wanted to use C# instead.