Esempio n. 1
0
    public void OnPointerGripPressDown(XREventData eventData)
    {
        var touchpadAxis = module.GetTouchpadAxis();

        canvas.enabled = isActive;
        //isActive = true;
        //canvas.enabled = true;
        //Debug.Log("Touchpad info (x,y)=" + touchpadAxis.x + ", " + touchpadAxis.y);
        Debug.Log("Button detected");
        isActive       = true;
        canvas.enabled = isActive;
    }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        var touchpadAxis   = module.GetTouchpadAxis();
        var thumbstickAxis = module.GetThumbstickAxis();

        if (Mathf.Abs(thumbstickAxis.y) > 0.2)
        {
            transform.Translate(speed * thumbstickAxis.y * module.transform.forward * Time.deltaTime);
        }
        if (Mathf.Abs(thumbstickAxis.x) > 0.2)
        {
            Vector3 A = Quaternion.AngleAxis(90, Vector3.up) * module.transform.forward;
            transform.Translate(speed * thumbstickAxis.x * A * Time.deltaTime);
        }
    }