Files
przygody-pana-cegly/scripts/components/SpaceshipExitComponent.cs
2025-08-30 23:06:12 +02:00

20 lines
459 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 player) return;
EmitSignalSpaceshipExit();
player.SetPlatformMovement();
}
}