19 lines
414 B
C#
19 lines
414 B
C#
using Godot;
|
|
|
|
namespace Mr.BrickAdventures.scripts.components;
|
|
|
|
public partial class SpaceshipExitComponent : Area2D
|
|
{
|
|
[Signal] public delegate void SpaceshipExitEventHandler();
|
|
|
|
public override void _Ready()
|
|
{
|
|
BodyEntered += OnBodyEntered;
|
|
}
|
|
|
|
private void OnBodyEntered(Node2D body)
|
|
{
|
|
if (body is not PlayerController) return;
|
|
EmitSignalSpaceshipExit();
|
|
}
|
|
} |