unity3d 我尝试通过点击按钮加载场景,但当我使用UnityEngine.SceneManagement编写时;它无法识别SceneManager.LoadScene行

3qpi33ja  于 2023-03-19  发布在  其他
关注(0)|答案(1)|浏览(194)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class MenuButton : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
    }

    public void LoadScene(string sceneName)
    {
        // this line below isn't recognized even if scene management is mentioned above
        SceneManager.LoadScene(sceneName)
    }
}

我看了一些Youtube视频,没有什么工作,而且当我写使用,它没有显示团结的建议,也没有现场管理的建议.

wgx48brx

wgx48brx1#

我见过一些人创建一个名为"SceneManager.cs"的脚本,这主要是导致这个问题的原因,因为它具有相同的名称,但命名空间不同。

相关问题