Hello
Please excuse the title.
My usual language is Javascript so please excuse me if im making an obvious mistake here in C#. However my problem is that I keep getting three errors
(1. Assets/Scripts/CSharpScripts/Career_Variables.cs(31,20): error CS0119: Expression denotes a type', where a
variable’, value' or
method group’ was expected
2.Assets/Scripts/CSharpScripts/Career_Variables.cs(31,13): error CS1502: The best overloaded method match for UnityEngine.GUI.Button(UnityEngine.Rect, string)' has some invalid arguments And 3.Assets/Scripts/CSharpScripts/Career_Variables.cs(31,13): error CS1503: Argument
#1’ cannot convert object' expression to type
UnityEngine.Rect’)
whenever I try to play one of my scripts.
Here is the code
using UnityEngine;
using System.Collections;
public class Career_Variables : MonoBehaviour {
Texture StartRacing;
GUIStyle bigger_option_GUI_Style;
GUIStyle smaller_option_GUI_Style;
GUIStyle two_smaller_option_GUI_Style;
int Fame;
int Fame_level;
int money = 30000;
int Races_Completed;
int Races_won;
int Races_lost;
void Start () {
}
void Update () {
}
void OnGUI()
{
GUI.Label(new Rect(605, 8, 20, 20), money.ToString(), bigger_option_GUI_Style);
GUI.Label(new Rect(850, 100, 20, 20), Races_Completed.ToString(), smaller_option_GUI_Style);
GUI.Label(new Rect(1155, 130, 20, 20), Fame.ToString(), two_smaller_option_GUI_Style);
GUI.Label(new Rect(1319, 100, 20, 20), Races_won.ToString(), two_smaller_option_GUI_Style);
if (GUI.Button(Rect(5,140,265,180), StartRacing))
Application.LoadLevel ("Level Select");
}
}
What I am trying to do is make a C# script to handle a few textures and a few variables for Career mode in my racing game. However I keep getting those 3 errors.
Its probably something simple but all help will be appreciated.
Thank you in advance