googlevr / gvr-unity-sdk

Google VR SDK for Unity
http://developers.google.com/vr/unity/
Other
2.71k stars 1.1k forks source link

GvrControllerInputDevice.StatePtr always return IntPtr.zero #1019

Open shiena opened 5 years ago

shiena commented 5 years ago

HARDWARE/SOFTWARE VERSIONS

STEPS TO REPRODUCE THE ISSUE

  1. Import GoogleVRForUnity_1.190.1.unitypackage
  2. Open Assets/GoogleVR/Demos/Scenes/HelloVR
  3. Attach the following script to Player/GvrControllerPointer0
  4. Build and Run in Mirage Solo
using System;
using UnityEngine;

[RequireComponent(typeof(GvrTrackedController))]
public class StatePtrTest : MonoBehaviour
{
    private GvrTrackedController _controller;

    void Start()
    {
        _controller = GetComponent<GvrTrackedController>();
    }

    void Update()
    {
        Debug.LogFormat("[{0}]{1}", name, _controller.ControllerInputDevice.StatePtr != IntPtr.Zero);
    }
}

ADDITIONAL COMMENTS

GvrControllerInputDevice.StatePtr should return gvr_controller_state* as described in the comment.