O'Reilly logo

Unity 3 Game Development HOTSHOT by Jate Wittayabundit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix C. Major Differences between C# and Unity JavaScript

This appendix will provide a brief reference of the syntactical differences between C# and JavaScript in Unity. This section references from the Unity answer forum:

http://answers.unity3d.com/questions/12911/what-are-the-syntax-differences-in-c-and-javascrip.html.

Unity Script Directives

Unity has a number of Script Directives, and we can find them at this URL: http://unity3d.com/support/documentation/ScriptReference/20_class_hierarchy.Attributes.html, for example RequireComponent.

JavaScript:

@script RequireComponent(Rigidbody)

C#:

[RequireComponent(typeof(Rigidbody))]

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required