Add Alot of stuff, Computer, repairStation, Whole game, Many things!

This commit is contained in:
2024-11-18 06:31:28 +01:00
parent 19b7964f83
commit a2091c3cf2
430 changed files with 55285 additions and 715 deletions

View File

@@ -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);
}
}