Ejemplo n.º 1
0
    public void ProcessTouchPadDown()
    {
        if (!currentObject)
        {
            return;
        }

        Interacable interacable = currentObject.GetComponent <Interacable>();

        interacable.Pressed();
    }
Ejemplo n.º 2
0
    private void processUI(GameObject obj)
    {
        if (currentObject != null)
        {
            if (obj == currentObject)
            {
                return;
            }

            clearSelectionUI();
        }

        currentObject = obj;

        Interacable inter = currentObject.GetComponent <Interacable>();

        inter.increase();
    }
Ejemplo n.º 3
0
    void Interact()
    {
        // If right mous button is pressed, cast ray, detect interacables and interact
        if (Input.GetMouseButton(1))
        {
            Ray        ray = mainCam.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;

            if (Physics.Raycast(ray, out hit, 100))
            {
                Interacable interacable = hit.collider.GetComponent <Interacable>();
                if (interacable != null)
                {
                    SceneManager.LoadScene(3);
                }
            }
        }
    }