mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
21 lines
No EOL
424 B
C#
21 lines
No EOL
424 B
C#
using Godot;
|
|
|
|
namespace Cirno.Scripts.Interactables;
|
|
|
|
public partial class HitButton : Switch
|
|
{
|
|
public override void _Ready()
|
|
{
|
|
base._Ready();
|
|
this.AreaEntered += OnAreaEntered;
|
|
}
|
|
|
|
private void OnAreaEntered(Area2D area)
|
|
{
|
|
if (area is not Bullet bullet) return;
|
|
|
|
this.Activate(this.ActivationType);
|
|
|
|
bullet.RequestCollisionDestruction();
|
|
}
|
|
} |