mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:05:34 +00:00
selector changes
This commit is contained in:
parent
686dea6c8d
commit
f9432a61ee
11 changed files with 103 additions and 16 deletions
|
|
@ -56,6 +56,12 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
|
|||
[Signal]
|
||||
public delegate void HealthChangedEventHandler(float newHealth, float MaxHealth);
|
||||
|
||||
[Signal]
|
||||
public delegate void InteractableAreaEnteredEventHandler(Interactable interactable);
|
||||
|
||||
[Signal]
|
||||
public delegate void InteractableAreaExitedEventHandler(Interactable interactable);
|
||||
|
||||
public float CurrentHealth
|
||||
{
|
||||
get => _currentHealth;
|
||||
|
|
@ -259,6 +265,8 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
|
|||
{
|
||||
Debug.WriteLine($"Interactable {area.Name} Entered");
|
||||
|
||||
EmitSignal(nameof(InteractableAreaEntered), interactable);
|
||||
|
||||
if (_selector != null)
|
||||
{
|
||||
_selector.Position = interactable.Position;
|
||||
|
|
@ -270,7 +278,12 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
|
|||
|
||||
private void _on_interaction_controller_area_exited(Area2D area)
|
||||
{
|
||||
|
||||
if (area.IsInGroup("Interactable") && area is Interactable interactable)
|
||||
{
|
||||
Debug.WriteLine($"Interactable {area.Name} Exited");
|
||||
|
||||
EmitSignal(nameof(InteractableAreaExited), interactable);
|
||||
}
|
||||
}
|
||||
|
||||
private void Explode()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue