Because a)UnityScript is not JavaScript, so the TypeScript tools would need to be extended to output the slightly different code required, and b)TypeScript is basically a C#-like mutation on top of JS, so why not just go straight to C#?
I’m not looking to shoehorn Typescript into UnityScript. I’m wondering if Typescript can be compiled directly into .NET assemblies runnable on Mono (and, hence, Unity3d).
Please dispense with “just use C#” responses. I’m perfectly capable of writing C# – have for years. I’m also well versed in many other languages, too. The question deserves more of answer than “because C#”.
Because there’s lots of reusable Typescript code out there (as well as JavaScript with .d.ts descriptors that enable plain .js projects to be Typescript compliant).
I don’t think that’s good enough, frankly. I always disliked how Unity was fragmented by supporting multiple languages and I kind of like that they are slowly going toward the C# only route.
I am not fundamentally against them adding another language, or switching to another language completely, but there have to be tangible benefits. And “there’s lots of reusable code out there” doesn’t cut it, for me.
It would appear that Unity is slowly going the route that Epic Games took with Unreal Engine 4. A single unified language for programmers, and a visual scripting interface for non-programmers. It keeps things simple and unified, makes adding and documenting new features easier, and new language support can be added via plugins from third parties if desired.
Hmph. Does for me, and I’m not just referring to Typescript. Java, Go, LLVM-compliant stuff, you name it.
Seems like any language that can get compiled to a .NET assembly that can run on Mono should be welcomed with open arms. And with JVM-to-.NET bytecode translators out there, seems that any JVM-compliant language should be in the mix, too.
Any language that can be compiled down to IL can be used with Unity. It’s not a common route, but it’s certainly doable.
Unity has indicated that they will only provide an official compiler for C#. But there is no reason you can’t use a compiler outside of Unity and just import the dll.
Unity is looking to drop JS already, and the Unity community has largely consolidated around C# in the past few years. Adding additional language support now would mean significantly more work for Unity (not just in maintaining support for the new language, but documenting everything in 2 languages, making tutorials, etc). It would be a huge and ongoing investment for Unity. What really are the gains though?