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.
I had similar problem.
Reimporting assests didn't help, as restarting the computer, reinstaling the same version of unity and reinstalling visual studio.
Finnaly I got it to work by updating to unity beta.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With