31 lines
562 B
C#
31 lines
562 B
C#
using Godot;
|
|
using System;
|
|
|
|
public partial class PauseMenu : Control
|
|
{
|
|
private static PauseMenu Instance;
|
|
public override void _Ready()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
public void Continue()
|
|
{
|
|
GetParent<Control>().Visible = false;
|
|
GetTree().Paused = false;
|
|
}
|
|
public void Restart()
|
|
{
|
|
GetTree().Paused = false;
|
|
GetTree().ReloadCurrentScene();
|
|
}
|
|
public void Exit()
|
|
{
|
|
GetTree().ChangeSceneToFile("uid://bfstrli64u23y");
|
|
}
|
|
public static void Pause()
|
|
{
|
|
Instance.GetParent<Control>().Visible = true;
|
|
Instance.GetTree().Paused = true;
|
|
}
|
|
}
|