Assets/NumberWizard.cs(5,9): error CS1041: Identifier expected: public' is a keyword, and Assets/NumberWizard.cs(25,14): error CS1525: Unexpected symbolpublic’.
using UnityEngine;
using System.Collections;
using UnityEngine.UI
public class NumberWizard : MonoBehaviour {
// Use this for initialization
int max;
int min;
int guess;
int maxGuessesAllowed = 10;
public Text text;
void Start () {
StartGame ();
}
void StartGame () {
max = 1000;
min = 1;
guess = 500;
public void GuessLower(){
max = guess;
NextGuess ();
}
public void GuessHigher(){
min = guess;
NextGuess ();
}
void NextGuess () {
guess = (max + min) /2;
text.text = guess.ToString();
maxGuessesAllowed = maxGuessesAllowed - 1;
if (maxGuessesAllowed <= 0){
Application.LoadLevel("Win");
}
}
Sure thing. ` using UnityEngine;
using System.Collections;
using UnityEngine.UI
public class NumberWizard : MonoBehaviour {
// Use this for initialization
int max;
int min;
int guess;
int maxGuessesAllowed = 10;
public Text text;
void Start () {
StartGame ();
}
void StartGame () {
max = 1000;
min = 1;
guess = 500;
}
public void GuessLower(){
max = guess;
NextGuess ();
}
public void GuessHigher(){
min = guess;
NextGuess ();
}
void NextGuess () {
guess = (max + min) /2;
text.text = guess.ToString();
maxGuessesAllowed = maxGuessesAllowed - 1;
if (maxGuessesAllowed <= 0){
Application.LoadLevel("Win");
}
}