JavaScript可以明确用于开发Unity游戏吗

JavaScript可以明确用于开发Unity游戏吗

本文介绍了JavaScript可以明确用于开发Unity游戏吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够在一段时间内对我提出一个问号的权威答案。似乎经常使用术语JavaScript来表示或描述UnityScript。

I would like an authoritative answer on a point that has been a question mark for me for a little while. There seems to be a frequent use of the term JavaScript to mean or describe UnityScript.

我一再被告知你可以使用实际的JavaScript在Unity中开发游戏,但是据我所知,UnityScript最多可以被描述为超集JavaScript,但确实有一些项目可能不完全兼容,你不能像通常那样只使用JS来开发Unity游戏,因为你必须按照惯例。

I have been told time and again that you can use actual JavaScript to develop games in Unity, however from what I understand UnityScript could, at best, be described as a superset of JavaScript, but there really are some items that perhaps aren't completely compatible and you can't simply use JS as you normally would to develop Unity games as you would have to follow their conventions.

我错了吗?您是否可以直接使用纯JS及其约定来使Unity游戏不遵循UnityScript设置的参数?

Am I wrong about this? Can you actually use pure JS and its conventions directly to make Unity games outside of following the parameters that UnityScript has set?

推荐答案

短回答:不,你不能使用PURE JavaScript。据我所知 - Unity使用它自己的类似JS的语法(有些人将其称为Unity JS),但它通常被称为UnityScript。

Short answer: No you cannot use PURE JavaScript. As far an I am aware - Unity uses it's own JS-like syntax (some people refer to it as Unity JS) but it is most commonly known as UnityScript.

您的问题源于Unity社区将JavaScript和UnityScript视为等效且可互换的事实。

Your question arises from the fact that the Unity community refers to JavaScript and UnityScript as if they are equivalent and interchangeable.

虽然这些外观和感觉非常相似 - 但有一些基本的区别,例如UnityScript是基于类的,而JavaScript不支持类。

Whilst these look and feel extremely similar - there are some fundamental differences such as UnityScript being class-based whilst JavaScript doesn't support classes.

您绝对可以使用您在UnityScript中选择的先前JavaScripting约定,因为它很多适用。使用的语义有点不同 - 但我发现不需要花很长时间才能了解这些小变化。

You can definitely use prior JavaScripting conventions you have picked up within UnityScript as a LOT of it applies. The semantics used are a little different - but I've found it doesn't take long to pick up on the small changes.

在此处阅读更多相关信息:

Read more about it here: UnityScript versus JavaScript

快乐编码!

这篇关于JavaScript可以明确用于开发Unity游戏吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 22:32