Unity build setup error

I am using Unity 5.6.0f3 and was facing this error while trying to build and run. Ive checked in monodeveloper building and the script is working and it says build success. when I try to use Windows / Mac / Linux I get the following error messages.

Assets / scripts / LevelManager.cs (4.19): Error CS0234: The type or namespace name SceneManagement 'does not exist in namespaceUnityEngine. Are you missing an assembly reference?

Assets / Scripts / LevelManager.cs (6.29): Error CS0246: Type or namespace name 'MonoBehaviour' could not be found. Are you missing a build?

Player build failed because scripts had compiler errors

.cs looks like this

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();
    }
}

      

It seems to me that there is no answer on the net, and I cannot figure it out now.

+3


source to share


1 answer


I had a similar problem.

Re-mappings didn't help, like restarting the computer, restoring the same version of unity, and reinstalling visual studio.



Finnaly I got it to work by upgrading to beta.

+1


source







All Articles