private void AddXRServiceProvider() { Transform cameraTransform = humanoid.headTarget.unityVRHead.cameraTransform; if (cameraTransform != null) { Leap.Unity.LeapXRServiceProvider serviceProvider = cameraTransform.GetComponent <Leap.Unity.LeapXRServiceProvider>(); if (serviceProvider == null) { cameraTransform.gameObject.AddComponent <Leap.Unity.LeapXRServiceProvider>(); } } }
public void OnEnable() { #if VRTK_DEFINE_SDK_LEAP_MOTION Leap.Unity.LeapXRServiceProvider leapXRServiceProvider = FindObjectOfType <Leap.Unity.LeapXRServiceProvider>(); if (leapXRServiceProvider != null) { leapServiceProvider = leapXRServiceProvider; } else { Debug.LogError("Leap Motion Gesture Library: no leap service provider found!"); } #endif }