|
|
|
|
|
|
[Header("Listening to")] |
|
|
|
//Check if the interaction ended
|
|
|
|
[SerializeField] private VoidEventChannelSO _onInteractionEnded = default; |
|
|
|
[SerializeField] private VoidEventChannelSO _oninteractResponsed = default; |
|
|
|
[SerializeField] private VoidEventChannelSO _oninteractionResponsed = default; |
|
|
|
_oninteractResponsed.OnEventRaised += OninteractionResponseActivated; |
|
|
|
_oninteractionResponsed.OnEventRaised += OnInteractionResponseActivated; |
|
|
|
_onInteractionEnded.OnEventRaised += OnInteractionEnd; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
_inputReader.interactEvent -= OnInteractionButtonPress; |
|
|
|
_oninteractResponsed.OnEventRaised -= OninteractionResponseActivated; |
|
|
|
_oninteractionResponsed.OnEventRaised -= OnInteractionResponseActivated; |
|
|
|
_onInteractionEnded.OnEventRaised -= OnInteractionEnd; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// interaction button press event handler activated by the StateMachine
|
|
|
|
void OninteractionResponseActivated() |
|
|
|
void OnInteractionResponseActivated() |
|
|
|
{ |
|
|
|
//remove interaction after press
|
|
|
|
Interaction onGoingInteraction = _ongoingInteractions.Count > 0 ? |
|
|
|