【Unity游戏开发基础】如何用脚本退出游戏

【背景】
不废话了,这个当然是最常用的。写个脚本,把方法挂载在Button元素的动作上就可以了。
【脚本】

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

public class jumpScene : MonoBehaviour
{
    
    
    public void QuitGame()
    {
    
    
        Application.Quit();
    }
}

核心方法是QuitGame

猜你喜欢

转载自blog.csdn.net/weixin_41697242/article/details/125212042