Add new components: CannotStompComponent, SkillUnlockedComponent, SpaceshipEnterComponent, SpaceshipExitComponent, SpinComponent, StompDamageComponent, StraightMotionComponent, TerrainHitFx, TooltipComponent, TrailComponent, and UnlockOnRequirementComponent
This commit is contained in:
20
scripts/components/SpaceshipExitComponent.cs
Normal file
20
scripts/components/SpaceshipExitComponent.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Godot;
|
||||
|
||||
namespace Mr.BrickAdventures.scripts.components;
|
||||
|
||||
public partial class SpaceshipExitComponent : Node
|
||||
{
|
||||
[Export] public Area2D Area { get; set; }
|
||||
[Signal] public delegate void SpaceshipExitEventHandler();
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
Area.BodyEntered += OnBodyEntered;
|
||||
}
|
||||
|
||||
private void OnBodyEntered(Node2D body)
|
||||
{
|
||||
if (body is not PlayerController) return;
|
||||
EmitSignalSpaceshipExit();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user