Game Development Reference
In-Depth Information
y
(5, 4)
(0, 0)
x
Figure 2-30.
The Cartesian Coordinate system
Search for Vector2 in the Unity Scripting Reference (Figure
2-31
).
Figure 2-31.
Vector2 description in the Unity Scripting Reference
In MonoDevelop, update your code to look like this:
#pragma strict
var myVector : Vector2 = Vector2(2, 3);
function Start () {
Debug.Log(myVector);
}
Click Play to test and you'll see the (x, y) coordinates of (2, 3) that you assigned to
myVector
displayed in the Console panel (Figure
2-32
).