I have created 3 scenes (StartMenu, Game, Win) and added all of them to built setting with proper arrangement. StartMenu Scene has a button start which should take game to second Game Scene when onClick event is called on it.
The onClick event of start button is mapped to LevelManager Empty Object. That object has a script LevelManager whose code I have posted.
I have added all those scenes to built settings.
but still I am getting this error:
Level 'name'(-1) couldn't be loaded because it has been added to the built settings.
To add a level to the built settings use menu File->Built settings.
UnityEngine.Application:LoadLevel(String)
LevelManager:LoadLevel(String) (at Assets/Scripts/LevelManager.cs:8) // 8 line is Application.LoadLevel line)
UnityEngine.EventSystems.EventSystem:Update()
Error Code:
LevelManager.cs
using UnityEngine;
using System.Collections;
public class LevelManager : MonoBehaviour {
public void LoadLevel(string name){
Application.LoadLevel(name);
}
public void QuitRequest(){
Debug.Log("Quit Requested");
}
}