Unity: Do I have to learn one, or both (C#, UnityScript)

懵懂的女人 提交于 2019-12-10 18:22:43

问题


I originally thought that one had to know both C# as well as UnityScript to develop using Unity. But it now seems that I only need to know one. So,

  1. Do both the languages do similar things and hence I should code in one, or should I learn them both as I'm supposed to use both?
  2. Does Unity only use C# and/or UnityScript cuz I always thought games had to use at least 2, even in Wikipedia, it's written as if it's a definition or something. (I know some games can be made solely using pygame and stuff, but I mean things like AAA titles).
  3. Continuing from 2 Or is it that you do use more than just C# and/or UnityScript in case of using Unity, and Unity is only for certain parts of the game?

回答1:


"unityscript" is deprecated.

You must use c#. It's that simple.


From my very limited development in Unity:

It's an either or thing.

I've written quick test-of-skill games using only C# as I'm more familiar with it from previous knowledge of C and C++. While reading the docs to decide whether or not I would try to port code over to the UnityScript code (again, as a test of skill), it became my understanding that either way you get the end result you want.

In these games I wrote all sorts of components, including UI, game object, terrain collision, even fiddling with jumping and the gravity engine. Never once did I have to stop and go "well darn. Looks like I need to use Unity Script for this."

Games in Unity, as far as I am aware, can use both. But I've never been forced into having to use one or the other.

If you ever run into a part where Unity forces you to use both, go ahead and come back to this post to yell at me.




回答2:


You can pretty much use whichever language you're most comfortable with. There will be the odd asset that uses one language when you prefer another. If you want to use and tweak the functionality of that asset, you'll need to do so in their language.

The scripts work in tandem and both can exist within a given project at the same time. Doing this can get messy as evidenced by this issue:

Unity3d: Accessing JS variable from c# and vice versa

I believe some of the basic freely available assets are in UnityScript such as the character controller. If you're planning to use one of these heavily and will need to communicate with those scripts regularly, it may inform your language decision. Hope this helps.




回答3:


Too many question in a single post, well try to provide answer accordingly.

  1. Do both the languages do similar things

Answer: In Programming, Theoretically, mathematically, strictly, yes. They're all equivalent. In practice, no, they vary fairly wildly. ref

I should code in one, or should I learn them both as I'm supposed to use both?

Answer: I would say it depends very much on your past experience. If your background is in C++ or Java, you will likely feel most at home in C# - however if you're experienced with dynamically typed languages such as JavaScript / Basic or PHP, chances are you will prefer JavaScript.

If you have no previous experience with programming - JavaScript might be an easier introduction - given that you do not need to worry about types and casting.ref

Does Unity only use C# and/or UnityScript cuz I always thought games had to use at least 2

Answer: absolutely not mandatory, much depends upon you expertise, requirement, teams strength and management.

Unity is only for certain parts of the game?

Answer: Absolutely yes, unity allow you to build, do lighting and provide some particle effects(if require). it not allow you complex modelling it provide interface to programming even mono-developer is a separate application.

helpful links:

  1. https://gamedev.stackexchange.com/questions/8118/what-are-the-pro-cons-of-unity3d-as-a-choice-to-make-games
  2. https://www.quora.com/What-are-the-main-pros-and-cons-of-Unity-3D-and-Unreal-Engine


来源:https://stackoverflow.com/questions/37558716/unity-do-i-have-to-learn-one-or-both-c-unityscript

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