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))]
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.49.247