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

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;

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