I've been getting these errors.
1. (6,29): error CS1519: Unexpected symbol `:' in class, struct, or interface member declaration
2. (6,35): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
3. (7,30): error CS1519: Unexpected symbol `:' in class, struct, or interface member declaration
4. (7,36): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
How do I fix these?
The code:
using UnityEngine;
using System.Collections;
public class Door: MonoBehaviour {
public bool killDoor = false;
public var winlevel : int = 1;
public var loselevel : int = 1;
// When player choose the door, pass the parameter here.
void OnMouseDown ()
{
if (killDoor) {
print ("Game Ogre.");
Application.LoadLevel(loselevel);
} else {
print ("Success!");
Application.LoadLevel (winlevel);
}
}
}
↧