add some signals to the event bus

This commit is contained in:
Chris Cromer 2022-11-10 00:10:05 -03:00
parent b63cd81c2f
commit d5a6585999
Signed by: cromer
GPG Key ID: FA91071797BEEEC2
2 changed files with 15 additions and 20 deletions

View File

@ -1,20 +0,0 @@
using Godot;
using System;
public class Event : Node
{
[Signal]
delegate void GameStarted(string example);
public override void _Ready()
{
var events = (Event) GetNode("/root/Event");
events.Connect("GameStarted", this, "MyCallBack");
events.EmitSignal("GameStarted", " my extra string");
}
public void MyCallBack(string example) {
GD.Print("signal worked" + example);
}
}

15
scripts/Event.cs Normal file
View File

@ -0,0 +1,15 @@
using Godot;
public sealed class Event : Node
{
[Signal]
delegate void EnergyCollected(int energy);
[Signal]
delegate void BoltCollected(int bolt);
[Signal]
delegate void InvincibilityCollected();
[Signal]
delegate void FireCollected();
[Signal]
delegate void PlayerTouched();
}