// Initialization void Start() { //Add an event of PointableUpdated. LeapInput.PointableUpdated += new LeapInput.PointableUpdatedHandler(OnPointableUpdated); targetScript = GameObject.Find("LeapController").GetComponent <LeapUnityBridge>(); if (m_Use_mouse) { UseMouseFinger(); } }
/// <summary> /// Acquires a reference to leap unity bridge component and sets initial _handParentObject offset /// </summary> void InitializeLeapUnityBridge() { if (LeapUnityBridge == null) { LeapUnityBridge = (LeapUnityBridge)GameObject.FindObjectOfType(typeof(LeapUnityBridge)); } if (LeapUnityBridge == null) { Debug.LogError("There is no LeapUnityBridge component in the scene!"); return; } if (LeapUnityBridge.m_InputParent != null) { _handParentObjectInitialOffset = LeapUnityBridge.m_InputParent.transform.position; } else { _handParentObjectInitialOffset = Vector3.zero; } }