rename eventBus to event
This commit is contained in:
parent
bb6550851a
commit
b6a5a1f829
@ -5,11 +5,11 @@ public class Bolt : Area2D
|
|||||||
{
|
{
|
||||||
[Export]
|
[Export]
|
||||||
private int _value = 1;
|
private int _value = 1;
|
||||||
private Event _eventBus;
|
private Event _event;
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
_eventBus = GetNode<Event>("/root/Event");
|
_event = GetNode<Event>("/root/Event");
|
||||||
GetNode<AnimatedSprite>("AnimatedSprite").Play();
|
GetNode<AnimatedSprite>("AnimatedSprite").Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ public class Bolt : Area2D
|
|||||||
|
|
||||||
public void Collected()
|
public void Collected()
|
||||||
{
|
{
|
||||||
_eventBus.EmitSignal("BoltCollected", _value);
|
_event.EmitSignal("BoltCollected", _value);
|
||||||
QueueFree();
|
QueueFree();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,12 +3,12 @@ using System;
|
|||||||
|
|
||||||
public class Energy : Area2D
|
public class Energy : Area2D
|
||||||
{
|
{
|
||||||
private Event _eventBus;
|
private Event _event;
|
||||||
private AnimatedSprite _sprite;
|
private AnimatedSprite _sprite;
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
_eventBus = GetNode<Event>("/root/Event");
|
_event = GetNode<Event>("/root/Event");
|
||||||
_sprite = GetNode<AnimatedSprite>("AnimatedSprite");
|
_sprite = GetNode<AnimatedSprite>("AnimatedSprite");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ public class Energy : Area2D
|
|||||||
SetCollisionLayerBit((int) Game.PhysicsLayer.Collectable, false);
|
SetCollisionLayerBit((int) Game.PhysicsLayer.Collectable, false);
|
||||||
if (String.Equals(body.Name, "Player"))
|
if (String.Equals(body.Name, "Player"))
|
||||||
{
|
{
|
||||||
_eventBus.EmitSignal("EnergyCollected", 1);
|
_event.EmitSignal("EnergyCollected", 1);
|
||||||
}
|
}
|
||||||
QueueFree();
|
QueueFree();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user