full gamepad support
This commit is contained in:
parent
31ba172123
commit
a57d79e84a
21 changed files with 213 additions and 46 deletions
|
|
@ -1,45 +0,0 @@
|
|||
using Godot;
|
||||
using Newlon;
|
||||
using System;
|
||||
|
||||
public partial class PauseMenu : Control
|
||||
{
|
||||
private static PauseMenu Instance;
|
||||
private bool previousPaused;
|
||||
private bool currently_paused = false;
|
||||
private AudioStream pauseSound = ResourceLoader.Load<AudioStream>("uid://ckja8ym50y0d4");
|
||||
public override void _Ready()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public void Continue()
|
||||
{
|
||||
GetParent<Control>().Visible = false;
|
||||
GetTree().Paused = previousPaused;
|
||||
currently_paused = false;
|
||||
}
|
||||
public void Restart()
|
||||
{
|
||||
GetTree().Paused = false;
|
||||
LevelController.Instance.RestartLevel();
|
||||
currently_paused = false;
|
||||
}
|
||||
public void Exit()
|
||||
{
|
||||
LevelController.Instance.EndLevel();
|
||||
currently_paused = false;
|
||||
}
|
||||
public static void Pause()
|
||||
{
|
||||
if (Instance.currently_paused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Instance.GetParent<Control>().Visible = true;
|
||||
Instance.previousPaused = Instance.GetTree().Paused;
|
||||
Instance.GetTree().Paused = true;
|
||||
Instance.currently_paused = true;
|
||||
AudioSequencer.Play("pause",Instance.pauseSound);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue