mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-12 09:15:54 +00:00
Partial selector fix
This commit is contained in:
parent
f7cbd7d171
commit
882608be72
2 changed files with 15 additions and 14 deletions
|
|
@ -214,15 +214,17 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
|
|||
|
||||
private void FindInteractable()
|
||||
{
|
||||
if (!Input.IsActionJustPressed("Use") || _selector.SelectedInteractable == null) return;
|
||||
if (!_selector.SelectedInteractable.CanActivate()) return;
|
||||
bool success = _selector.SelectedInteractable.Activate();
|
||||
var selected = _selector.SelectedInteractable;
|
||||
if (!Input.IsActionJustPressed("Use") || selected == null) return;
|
||||
if (!selected.CanActivate()) return;
|
||||
bool success = selected.Activate();
|
||||
|
||||
if (success)
|
||||
{
|
||||
// Deselect and scan for next
|
||||
_selector.SelectedInteractable = null;
|
||||
_selector.SelectNext();
|
||||
_selector.RemoveInteractable(selected);
|
||||
//_selector.SelectedInteractable = null;
|
||||
//_selector.SelectNext();
|
||||
}
|
||||
|
||||
//var spaceState = GetWorld2D().DirectSpaceState;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue