Game Development Reference
In-Depth Information
Appendix C
Major Differences
between C# and
Unity JavaScript
This appendix will provide a brief reference of the syntacical diferences between C# and
JavaScript in Unity. This secion 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))]