Hi,#
using unity 5.6.0f3 and have come across the Application.LoadLevel problem. found the solution and it runs in debug fine.
However when i do the build and run i get this error in the console
Assets/Scripts/LevelManager.cs(4,19): error CS0234: The type or namespace name
SceneManagement' does not exist in the namespace
UnityEngine’. Are you missing an assembly reference?
Assets/Scripts/LevelManager.cs(6,29): error CS0246: The type or namespace name `MonoBehaviour’ could not be found. Are you missing an assembly reference?
Error building Player because scripts had compiler errors
.cs is as follows
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class LevelManager : MonoBehaviour {
// On CLick button - Loads scence from event manager using the LoadLevel + name function below
public void Loadevel (string name) {
Debug.Log("Level load requested for: " + name);
SceneManager.LoadScene(name);
Debug.Log ("Loaded Level " + name);
}
// on click Quit
public void QuitLevel (string name) {
Debug.Log (“I want to Quit”);
Application.Quit (); // no use in Web build, Debug. Mobile ios, android, windows frowned upon!
}}
any one else had this error? google isnt helping me much
thanks