﻿using UnityEngine;
using System.Collections;

public class LevelManager : MonoBehaviour {

	public float autoLoadNextLevelAfter;

	void Start() {
		if (autoLoadNextLevelAfter <= 0) {
			Debug.Log ("Level Autoload disabled, must use positive delay value");
		} else {
			Invoke ("LoadNextLevel", autoLoadNextLevelAfter);
		}
	}

	public void Loadlevel(string name){
		Debug.Log("Load level requested: "+name);
		Application.LoadLevel(name);
	}
	public void QuitRequest(){
		Debug.Log ("Do you really want to quit, coward?");
		Application.Quit ();
	}

	public void LoadNextLevel(){
		Application.LoadLevel (Application.loadedLevel + 1);
	}
}
