Type names

A couple of the basic types are spelt differently in pure Unity C#. In JavaScript, we use Boolean and String, but in pure Unity C#, we use bool and string.

JavaScript:

var isHit : Boolean;
var myName : String;

C#:

bool isHit;
string myName;

However, there is an exception. If you include System in your C# script, you will be able to use String and Boolean classes (the upper-case) of .NET, similar to the following script:

C#:

using System;

Boolean isHit;
String myName;
..................Content has been hidden....................

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