错误 CS0246:找不到类型或命名空间名称 'LoadSceneMode'(是否缺少 using 指令或程序集引用?)

error CS0246: The type or namespace name 'LoadSceneMode' could not be found (are you missing a using directive or an assembly reference?)

我仍在学习有关在 unity 中制作 2d 游戏的教程。我正在处理 GameManager 脚本,但我收到命名空间 LoadSceneMode 的错误,即使我在处理代码时也正在处理代码。

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameManager : MonoBehaviour
{
    public static GameManager instance;
    private void Awake()
    {
        instance = this;
    }

    // Ressources
    public List<Sprite> playerSprites;
    public List<Sprite> weaponsprites;
    public List<int> weaponPrices;
    public List<int> xpTable;

    // References
    public player player;
    // public weapon weapon..

    //Logic
    public int pesos;
    public int experience;
    

    // Save state
    /*
     * INT preferedSkin
     * INT pesos
     * INT experience
     * INT weaponLevel
     */
    public void SaveState()
    {
        string s = "";

        s += "0" + "|";
        s += pesos.ToString() + '|';
        s += experience.ToString() + '|';
        s += "0";

        PlayerPrefs.SetString("SaveState", s);
    }

    public void LoadState(Scene s, LoadSceneMode mode)
    {
        string[] data = PlayerPrefs.GetString("SaveState").Split('|');

        // Change player skin
        pesos = int.Parse(data[1]);
        experience = int.Parse(data[2]);
        // Change the weapon level


        Debug.Log("LoadState");
    }

}

我已经尝试重新输入脚本,但我仍然遇到同样的错误。 它说可以在 (47,36)

行找到错误

您需要将 UnityEngine.SceneManagement 命名空间添加到您的代码中。

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
..........