예제 #1
0
 public static string ToAttributeString(this FingerType _this)
 {
     if (_this < FingerType.Last)
     {
         return(_this.ToString());
     }
     throw new ArgumentException(_this.ToString());
 }
        private void DisplayHandRotationNormalized(bool isRight)
        {
            string handLabel = isRight ? "Right Hand" : "Left Hand";

            EditorGUILayout.LabelField(handLabel);
            EditorGUI.indentLevel++;
            if (_dexmoController.HandControllerPairs == null ||
                _dexmoController.HandControllerPairs.Count == 0)
            {
                EditorGUILayout.LabelField(handLabel + " is not initialized.");
            }
            else
            {
                UnityHandController handController = isRight
                    ? _dexmoController.HandControllerPairs[0].Right
                    : _dexmoController.HandControllerPairs[0].Left;
                //if (!handController.Active)
                //{
                //    EditorGUILayout.LabelField(handLabel + " is not active.");
                //}
                //else
                {
                    IHandRotationNormalized handRotation =
                        handController.GetCurrentFingerRotationInfo();
                    int n = handRotation.Fingers.Length;
                    for (int i = 0; i < n; i++)
                    {
                        IFingerRotationNormalized fingerRotation =
                            handRotation.Fingers[i];
                        FingerType fingerType = (FingerType)i;
                        EditorGUILayout.LabelField(fingerType.ToString());
                        DisplayFingerRotationNormalized(fingerRotation);
                    }
                }
            }
            EditorGUI.indentLevel--;
        }
예제 #3
0
 public override string Name()
 {
     return(_side.ToString() + "_" + finger.ToString());
 }