rename eventBus to event

This commit is contained in:
Chris Cromer 2022-11-21 02:15:26 -03:00
parent bb6550851a
commit b6a5a1f829
2 changed files with 6 additions and 6 deletions

View File

@ -5,11 +5,11 @@ public class Bolt : Area2D
{
[Export]
private int _value = 1;
private Event _eventBus;
private Event _event;
public override void _Ready()
{
_eventBus = GetNode<Event>("/root/Event");
_event = GetNode<Event>("/root/Event");
GetNode<AnimatedSprite>("AnimatedSprite").Play();
}
@ -26,7 +26,7 @@ public class Bolt : Area2D
public void Collected()
{
_eventBus.EmitSignal("BoltCollected", _value);
_event.EmitSignal("BoltCollected", _value);
QueueFree();
}
}

View File

@ -3,12 +3,12 @@ using System;
public class Energy : Area2D
{
private Event _eventBus;
private Event _event;
private AnimatedSprite _sprite;
public override void _Ready()
{
_eventBus = GetNode<Event>("/root/Event");
_event = GetNode<Event>("/root/Event");
_sprite = GetNode<AnimatedSprite>("AnimatedSprite");
}
@ -19,7 +19,7 @@ public class Energy : Area2D
SetCollisionLayerBit((int) Game.PhysicsLayer.Collectable, false);
if (String.Equals(body.Name, "Player"))
{
_eventBus.EmitSignal("EnergyCollected", 1);
_event.EmitSignal("EnergyCollected", 1);
}
QueueFree();
}