using Godot;
using System;

public partial class pause_controller : Control
{
    private Control _pauseMenu;

    public override void _Ready()
    {
        _pauseMenu = GetNode<Control>("PauseMenu");
    }

    public override void _Input(InputEvent @event)
    {
        if (@event.IsActionPressed("pause"))
        {
            if (!GetTree().Paused)
            {
                GetTree().Paused = true;
                _pauseMenu.Visible = true;;
            }
            else
            {
                GetTree().Paused = false;
                _pauseMenu.Visible = false;
            }
        }
    }
    
}
