Ejemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (CheckForAnInteractableObject())
     {
         GameObject hitObject = hitResult.transform.gameObject;
         Logger.Log($"Hit Object: {hitObject.name}");
         interactableComponent = hitObject.GetComponent <InteractableComponent>();
         canInteract           = !(interactableComponent is null) && interactableComponent.isActiveAndEnabled &&
                                 hitObject.gameObject.layer == LayerMask.NameToLayer("Interactable");
         if (canInteract)
         {
             Logger.Log($"Found: {interactableComponent.gameObject.name}");
         }
     }
 }
Ejemplo n.º 2
0
 public virtual void OnInteractionCompleted(GameObject other)
 {
     Logger.Log("Interacted");
     onInteracted?.Invoke(other);
 }