ich habe den Error bei Unity:
All compiler errors have to be fixed before you can enter playmode!
UnityEditor.SceneView:ShowCompileErrorNotification ()
das sind die codes: 1.
using UnityEngine;
using UnityEngine.SceneManagement;
public class Door : MonoBehaviour
{
public GameObject doorObject;
void OnMouseDown()
{
if (Key.hasKey)
{
SceneManager.LoadScene("Level 2");
Debug.Log("Tür geöffnet!");
CompleteLevel;
}
else
{
Debug.Log("Du brauchst einen Schlüssel!");
}
}
}
Code: 2.
using UnityEngine;
using UnityEngine.SceneManagement;
public class LevelManager : MonoBehaviour
{
public static int currentLevel;
void Start()
{
currentLevel = PlayerPrefs.GetInt("CurrentLevel", 1);
}
public void CompleteLevel()
{
currentLevel++;
PlayerPrefs.SetInt("CurrentLevel", currentLevel);
PlayerPrefs.Save();
SceneManager.LoadScene("Level " + currentLevel);
}
}