// HELPERS private void CheckForInteractionObject() { Collider[] overlappedColliders = Physics.OverlapSphere(snapColliderOrigin.position, snapColliderOrigin.lossyScale.x / 2f); foreach (Collider overlappedCollider in overlappedColliders) { if (overlappedCollider.CompareTag("InteractionObject") && overlappedCollider.GetComponentInParent <WI_InteractionObject> ().IsFree()) { objectBeingInteractedWith = overlappedCollider.GetComponentInParent <WI_InteractionObject> (); objectBeingInteractedWith.OnTriggerWasPressed(this); Debug.Log("object: " + objectBeingInteractedWith.name); return; } } }
public void SwitchInteractionObjectTo(WI_InteractionObject interactionObject) { objectBeingInteractedWith = interactionObject; objectBeingInteractedWith.OnTriggerWasPressed(this); }