Getting **MANY** Errors!!! Here they are! BCE0022: Cannot convert 'int' to 'System.Type'. The type 'UnityEngine.Rect' does not have a visible constructor that matches the argument list '(float, System.Type, int, int)'. BCE0051: Operator '-' cannot be used with a left hand side of type 'System.Type' and a right hand side of type 'int'.BCE0051: Operator '+' cannot be used with a left hand side of type 'System.Type' and a right hand side of type 'int'.
Here is my code.
#pragma strict
var RedPlayer : GameObject;
var BluePlayer : GameObject;
var CurTeam : String = "";
var SpawnPointRed : GameObject;
var SpawnPointBlue : GameObject;
var CenterW : float;
var CenterH = float;
function Start ()
{
CurTeam = "";
CenterW = Screen.width / 2 - 150;
CenterH = Screen.height / 2 - 80;
}
function OnGUI ()
{
GUI.Box(Rect(CenterW, CenterH, 300, 160), "Select a Team");
if(CurTeam == "")
{
if(GUI.Button(Rect(CenterW + 5, CenterH - 20, 290, 65),"Red Team"))
{
}
if(GUI.Button(Rect(CenterW + 5, CenterH + 120, 290, 65),"Blue Team"))
{
}
}
else
{
if(GUI.Button(Rect(CenterW + 5, CenterH + 20, 290, 130),"Respawn"))
{
}
}
}
↧