rrtur
This commit is contained in:
@@ -36,17 +36,24 @@ namespace AfterHours.Interaction
|
||||
|
||||
private void RefreshTarget()
|
||||
{
|
||||
var previous = _current;
|
||||
_current = null;
|
||||
CurrentPrompt = null;
|
||||
|
||||
if (!Physics.Raycast(_eyes.position, _eyes.forward, out var hit, _reach, _interactableMask))
|
||||
return;
|
||||
if (Physics.Raycast(_eyes.position, _eyes.forward, out var hit, _reach, _interactableMask)
|
||||
&& hit.collider.TryGetComponent<IInteractable>(out var interactable))
|
||||
{
|
||||
_current = interactable;
|
||||
CurrentPrompt = interactable.GetPrompt(OwnerClientId);
|
||||
}
|
||||
|
||||
if (!hit.collider.TryGetComponent<IInteractable>(out var interactable))
|
||||
return;
|
||||
|
||||
_current = interactable;
|
||||
CurrentPrompt = interactable.GetPrompt(OwnerClientId);
|
||||
// TODO: entfernen, sobald ein echter Prompt im UI angezeigt wird.
|
||||
if (_current != previous)
|
||||
{
|
||||
Debug.Log(_current != null
|
||||
? $"[PlayerInteractor] Ziel im Blick: {CurrentPrompt}"
|
||||
: "[PlayerInteractor] Kein Ziel mehr im Blick.");
|
||||
}
|
||||
}
|
||||
|
||||
[Rpc(SendTo.Server)]
|
||||
|
||||
Reference in New Issue
Block a user