Beispiel #1
0
    public void OnPointerDown(PointerEventData eventData)
    {
        RaycastHit hit;
        Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);

        if (Physics.Raycast(ray, out hit))
        {
            if (hit.collider.CompareTag("Interactable"))
            {
                actualInteractable = hit.collider.GetComponent <InteractableBase>();
                actualInteractable.OnStartInteraction();
            }
        }
    }