Add Alot of stuff, Computer, repairStation, Whole game, Many things!
This commit is contained in:
@@ -43,7 +43,6 @@ public class InteractionBehaviour : MonoBehaviour, IObjectParentHolder {
|
||||
RaycastHit hit;
|
||||
Debug.DrawRay(origin, transform.forward * _interactionDistance, Color.red);
|
||||
if (Physics.Raycast(origin, transform.forward, out hit, _interactionDistance, _interactionLayer)) {
|
||||
// Debug.Log("Hitting something!");
|
||||
GameObject hitObject = hit.transform.gameObject;
|
||||
//Check if the object has a component that has the IInteractable interface
|
||||
if (hitObject.TryGetComponent(out IInteractable interactable)) {
|
||||
@@ -64,7 +63,7 @@ public class InteractionBehaviour : MonoBehaviour, IObjectParentHolder {
|
||||
public void Interact() {
|
||||
if (_lastInteractedObject == null) return;
|
||||
if (_lastInteractedObject.TryGetComponent(out IInteractable interactable)) {
|
||||
interactable.Interact();
|
||||
interactable.Interact(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user