What's wrong with this script?

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);
				}

	}
}

You’re using uScript syntax in a C# script.

public var winlevel : int = 1;
public var loselevel : int = 1;

should be

public int winlevel = 1;
public int loselevel = 1;

public var winlevel : int = 1;
public var loselevel : int = 1;

is not valid c#
change according to this pattern:

[access modifier] [ variable type] [variable name] = [value];
public int winlevel = 1;