23 lines
569 B
C#
23 lines
569 B
C#
|
|
using Godot;
|
|
|
|
namespace Gmtk24 {
|
|
public partial class Interactible : RigidBody3D {
|
|
[Signal]
|
|
public delegate void InteractedEventHandler(InputEvent e);
|
|
[Signal]
|
|
public delegate void HoveredEventHandler(bool hovered);
|
|
|
|
[Export]
|
|
public string InteractName;
|
|
|
|
public void HandleInput(InputEvent e) {
|
|
if (e.IsPressed())
|
|
EmitSignal(SignalName.Interacted, e);
|
|
}
|
|
|
|
public void SetHovered(bool hovered) {
|
|
EmitSignal(SignalName.Hovered, hovered);
|
|
}
|
|
}
|
|
} |