I'm using Unity 5.6.0f3 and have come across this error when I try build and run. Ive checked in monodeveloper building and running script and it says build success. when I try for windows/mac/Linux standlone I get the below error messages.
Assets/Scripts/LevelManager.cs(4,19): error CS0234: The type or namespace name SceneManagement' does not exist in the namespaceUnityEngine'. 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 {
public void Loadevel(string name) {
Debug.Log("Level load requested for: " + name);
SceneManager.LoadScene(name);
Debug.Log("Loaded Level " + name);
}
public void QuitLevel(string name) {
Debug.Log("I want to Quit");
Application.Quit();
}
}
Im cant seem to find any answer on the net and am unable to figure it out at present.
5.3, are you sure you're on5.6? Also, is the application able to run in the editor?