Add PhantomCamera components and UI elements for improved scene management; refactor existing components for better integration
This commit is contained in:
@@ -2,20 +2,19 @@ using Godot;
|
||||
|
||||
namespace Mr.BrickAdventures.scripts.components;
|
||||
|
||||
public partial class SpaceshipEnterComponent : Node
|
||||
public partial class SpaceshipEnterComponent : Area2D
|
||||
{
|
||||
[Export] public Area2D Area { get; set; }
|
||||
[Signal] public delegate void SpaceshipEnteredEventHandler();
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
Area.BodyEntered += OnBodyEntered;
|
||||
BodyEntered += OnBodyEntered;
|
||||
}
|
||||
|
||||
private void OnBodyEntered(Node2D body)
|
||||
{
|
||||
if (body is not PlayerController) return;
|
||||
EmitSignalSpaceshipEntered();
|
||||
Owner.QueueFree();
|
||||
QueueFree();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user