How to add JavaScript support to Unity 2019?

旧时模样 提交于 2021-01-27 16:09:27

问题


I developed a game years ago and now decided to improve the game and started to download the unity again. after upgrading Unity I figured out Unity doesn't know all JS files and has detached them from objects. any solution that fixes the problem and adds JS support to Unity again?


回答1:


  1. August 2017

All the way back to Unity 1.0, the Unity game engine has supported a version of JavaScript called UnityScript. Today on the Unity blog, Unity have announced that they will no longer be supporting UnityScript going forward. Starting in Unity 2017 beta 2, they will remove the ability to create JavaScript files directly inside the editor. Then they will be removing the ability to submit .js files to the Asset Store. Then at some point in the future they will be removing the compiler completely, although it will be available to be forked on Github. According to Unity analytics numbers on a very small portion of the community is even using UnityScript at this point, with under 4% using it as the primary language.

They actually published some fairly interesting stats about language usage:

To date, of all the projects that have used Unity 5.6, about 14.6% of them have at least one file with a .js extension in it. 14.6% sounds quite high, but then we broke the numbers down further, and looked at how many files were .js files as a fraction of total script files in the project (.js + .cs). So, that leaves 85.4% of all projects which are entirely in C#, with no UnityScript files at all. 9.5% of all projects are mostly in C# – they have some UnityScript files, but fewer than 10% of their total script file count. Another 1.5% of all projects have between 10% and 20% of their code in UnityScript files. That leaves 3.6% of all projects that have more than 20% of their code in UnityScript. Only 0.8% of all projects are exclusively (i.e. 100%) in UnityScript.

With only a small portion of the community using UnityScript it does make very little sense to continue supporting it, especially now that C# support isn’t stuck in the stone ages.



来源:https://stackoverflow.com/questions/60348922/how-to-add-javascript-support-to-unity-2019

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!