private void PoseUpdateEvent_ControllerStateUpdate(params Valve.VR.TrackedDevicePose_t[] args)
 {
     for (int i = 0; i < args.Length; i++)
     {
         for (int j = 0; j < 2; j++)
         {
             if (GameplayReferences.GetControllerInfo(j, out tempControllerInfo))
             {
                 if (tempControllerInfo.id == i)
                 {
                     tempControllerInfo.connected = args[i].bDeviceIsConnected;
                     tempControllerInfo.visible   = args[i].bPoseIsValid;
                 }
             }
         }
     }
 }
        void Update()
        {
            if (initResponse != Error.None)
            {
                return;
            }

            Core.InvokeUpdateEvent(Time.deltaTime);
            UpdateSendHotkeyCheck();

#if CVR_STEAMVR || CVR_STEAMVR2
            var system = Valve.VR.OpenVR.System;
            if (system != null)
            {
                var vrEvent = new Valve.VR.VREvent_t();
                var size    = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Valve.VR.VREvent_t));
                for (int i = 0; i < 64; i++)
                {
                    if (!system.PollNextEvent(ref vrEvent, size))
                    {
                        break;
                    }
                    OnPoseEvent((Valve.VR.EVREventType)vrEvent.eventType);
                }
            }
#endif

#if CVR_OCULUS
            if (GameplayReferences.GetControllerInfo(false, out tempControllerInfo))
            {
                tempControllerInfo.connected = OVRInput.IsControllerConnected(OVRInput.Controller.LTouch);
                tempControllerInfo.visible   = OVRInput.GetControllerPositionTracked(OVRInput.Controller.LTouch);
            }

            if (GameplayReferences.GetControllerInfo(true, out tempControllerInfo))
            {
                tempControllerInfo.connected = OVRInput.IsControllerConnected(OVRInput.Controller.RTouch);
                tempControllerInfo.visible   = OVRInput.GetControllerPositionTracked(OVRInput.Controller.RTouch);
            }
#endif
        }