+事件连琐
+对话框分化完毕 +打包Resources文件夹
This commit is contained in:
41
Assets/Scripts/UI/PausePanel.cs
Normal file
41
Assets/Scripts/UI/PausePanel.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI
|
||||
{
|
||||
public class PausePanel : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject pauseButton;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Time.timeScale = 1;
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
Continue();
|
||||
}
|
||||
}
|
||||
|
||||
public void Continue()
|
||||
{
|
||||
pauseButton.SetActive(true);
|
||||
Time.timeScale = 1;
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void Exit()
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
|
||||
public void MainMenu()
|
||||
{
|
||||
Time.timeScale = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user