protected virtual void Update() { if (Input.GetButtonDown("Activate")) { foreach (var x in proximityProbe.GetCloseObjects()) { IInteractible interactible = x.GetComponent <IInteractible>(); if (interactible != null) { interactible.AcceptBob(this); } } } }
public void AcceptBob(Bob source) { if (enabled) { IInteractible realTarget = target != null?target.GetComponent <IInteractible>() : null; if (realTarget != null) { realTarget.AcceptBob(source); } else { Debug.LogWarning("No target available to relay the call."); } } }