private void UpdateOvrHand()
 {
     try
     {
         FieldInfo handTypeField = m_ovrHand.GetType().GetField("HandType", BindingFlags.NonPublic | BindingFlags.Instance);
         handTypeField.SetValue(m_ovrHand, m_isLeftHand ? OVRHand.Hand.HandLeft : OVRHand.Hand.HandRight);
     }
     catch (Exception e)
     {
         Debug.LogError("Failed to update OVRHand: " + e);
     }
 }
Example #2
0
        private void ResolveHandType()
        {
            _hand = GetComponent <OVRHand>();

            FieldInfo info = _hand.GetType().GetField("HandType", BindingFlags.NonPublic | BindingFlags.Instance);

            if (info is null)
            {
                return;
            }

            OVRHand.Hand handType = (OVRHand.Hand)info.GetValue(_hand);

            switch (handType)
            {
            case OVRHand.Hand.HandLeft:
                _handType = HandType.Left;
                break;

            case OVRHand.Hand.HandRight:
                _handType = HandType.Right;
                break;
            }
        }