oldie/scenes/debugger/Bolts.cs

22 lines
430 B
C#
Raw Normal View History

2022-11-20 17:09:21 -03:00
using Godot;
using System;
public class Bolts : Label
{
private Game _game;
private Event _event;
public override void _Ready()
{
_game = GetNode<Game>("/root/Game");
_event = GetNode<Event>("/root/Event");
_event.Connect("BoltCollected", this, "OnBoltCollected");
Text = "0";
}
public void OnBoltCollected(int bolts)
{
Text = _game.Bolts.ToString();
}
}