19 lines
390 B
C#
19 lines
390 B
C#
using Godot;
|
|
|
|
namespace Mr.BrickAdventures.scripts.components;
|
|
|
|
[GlobalClass]
|
|
public partial class OutOfScreenComponent : Node
|
|
{
|
|
[Export] public VisibleOnScreenNotifier2D VisibilityNotifier { get; set; }
|
|
|
|
public override void _Ready()
|
|
{
|
|
VisibilityNotifier.ScreenExited += OnScreenExited;
|
|
}
|
|
|
|
private void OnScreenExited()
|
|
{
|
|
Owner?.QueueFree();
|
|
}
|
|
} |