mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 04:25:55 +00:00
3D Switches
This commit is contained in:
parent
003dde1b7f
commit
cb60226ced
20 changed files with 267 additions and 14 deletions
|
|
@ -48,8 +48,12 @@ public partial class IsoActivationProvider: Area3D, IModule<PlayerState, Charact
|
|||
StateMachine = machine;
|
||||
|
||||
_selectorController.Hide();
|
||||
|
||||
// TODO: Create selector UI element and link the signals
|
||||
|
||||
|
||||
if (Hud.Instance is not null)
|
||||
{
|
||||
Hud.Instance.CreateSelector(_selectorController);
|
||||
}
|
||||
|
||||
// if (SelectorScene is not null && _selector is null)
|
||||
// {
|
||||
|
|
@ -65,7 +69,9 @@ public partial class IsoActivationProvider: Area3D, IModule<PlayerState, Charact
|
|||
|
||||
public void PhysicsProcess(double delta)
|
||||
{
|
||||
|
||||
_selectorController.PhysicsProcess(delta);
|
||||
|
||||
HandleInteraction();
|
||||
}
|
||||
|
||||
public void HandleInteraction()
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ public partial class SelectorController : Node
|
|||
{
|
||||
if (SelectedInteractable != null)
|
||||
{
|
||||
EmitSignalChangePosition(SelectedInteractable.GetGlobalPosition());
|
||||
EmitSignalChangePosition(SelectedInteractable.GetScreenPosition());
|
||||
EmitSignalShowSelector();
|
||||
}
|
||||
else
|
||||
|
|
@ -136,4 +136,10 @@ public partial class SelectorController : Node
|
|||
{
|
||||
EmitSignalHideSelector();
|
||||
}
|
||||
|
||||
public void PhysicsProcess(double delta)
|
||||
{
|
||||
if (SelectedInteractable is null) return;
|
||||
EmitSignalChangePosition(SelectedInteractable.GetScreenPosition());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue