23 lines
376 B
C#
23 lines
376 B
C#
using Godot;
|
|
using System;
|
|
|
|
public partial class Pocket : Area2D
|
|
{
|
|
[Signal]
|
|
public delegate void OnBallPottedEventHandler(Ball BALL, Pocket THIS);
|
|
|
|
public override void _Ready()
|
|
{
|
|
|
|
BodyEntered += BallPotted;
|
|
}
|
|
|
|
public void BallPotted(Node NODE)
|
|
{
|
|
if (NODE is Ball)
|
|
{
|
|
EmitSignal(SignalName.OnBallPotted, (Ball)NODE, this);
|
|
}
|
|
}
|
|
}
|