28 lines
643 B
C#
28 lines
643 B
C#
using Godot;
|
|
|
|
public partial class MainMenuController : Node
|
|
{
|
|
public Button StartGameButton { get; private set; }
|
|
public Button ExitGameButton { get; private set; }
|
|
|
|
public override void _Ready()
|
|
{
|
|
base._Ready();
|
|
|
|
this.StartGameButton = GetNode<Button>("CenterContainer/VBoxContainer/StartGameButton");
|
|
this.ExitGameButton = GetNode<Button>("CenterContainer/VBoxContainer/ExitGameButton");
|
|
|
|
this.StartGameButton.Pressed += OnStartGame;
|
|
this.ExitGameButton.Pressed += OnExitGame;
|
|
}
|
|
|
|
public void OnStartGame()
|
|
{
|
|
GetTree().ChangeSceneToFile("res://scenes/game.tscn");
|
|
}
|
|
|
|
public void OnExitGame()
|
|
{
|
|
GetTree().Quit();
|
|
}
|
|
}
|