Example #1
0
        private void LowerLegConfigurationInspector(ref FootTarget.TargetedLowerLegBone lowerLeg, bool isLeft)
        {
            if (lowerLeg.bone.transform != null)
            {
                GUI.SetNextControlName(lowerLeg.bone.transform.name + "00");
            }
            lowerLeg.bone.transform = (Transform)EditorGUILayout.ObjectField("Lower Leg Bone", lowerLeg.bone.transform, typeof(Transform), true);
            if (lowerLeg.bone.transform != null)
            {
                EditorGUI.indentLevel++;

                lowerLeg.bone.jointLimitations = EditorGUILayout.Toggle("Joint Limitations", lowerLeg.bone.jointLimitations);
                if (lowerLeg.bone.jointLimitations)
                {
                    lowerLeg.bone.maxAngle = EditorGUILayout.Slider("Max Angle", lowerLeg.bone.maxAngle, 0, 180);
                }

                //EditorGUILayout.BeginHorizontal();
                //lowerLeg.bone.maxAngle = EditorGUILayout.Slider("Max Angle", lowerLeg.bone.maxAngle, 0, 180);
                //if (GUILayout.Button("R", GUILayout.Width(20))) {
                //    lowerLeg.bone.maxAngle = FootTarget.maxLowerLegAngle;
                //}
                //EditorGUILayout.EndHorizontal();

                //if (isLeft)
                //    Target_Editor.BoneAngleInspector(lowerLegMinX, lowerLegMaxX, FootTarget.minLeftLowerLegAngles.x, FootTarget.maxLeftLowerLegAngles.x, lowerLegYname, "X Limits");
                //else
                //    Target_Editor.BoneAngleInspector(lowerLegMinX, lowerLegMaxX, FootTarget.minRightLowerLegAngles.x, FootTarget.maxRightLowerLegAngles.x, lowerLegYname, "X Limits");
                EditorGUI.indentLevel--;
            }
        }
Example #2
0
        private void UpdateLowerLegBones(FootTarget.TargetedLowerLegBone lowerLeg)
        {
            //if (lowerLeg.bone.transform == null)
            //    return;

            //lowerLeg.bone.minAngles.x = lowerLegMinX.floatValue;
            //lowerLeg.bone.maxAngles.x = lowerLegMaxX.floatValue;
        }
Example #3
0
        //private string lowerLegYname;
        //private SerializedProperty lowerLegMinX;
        //private SerializedProperty lowerLegMaxX;

        private void InitLowerLegConfiguration(FootTarget.TargetedLowerLegBone lowerLeg)
        {
            //if (lowerLeg.bone.transform == null)
            //    return;

            //lowerLegYname = lowerLeg.bone.transform.name + "X";
            //lowerLegMinX = serializedObject.FindProperty("lowerLeg.bone.minAngles.x");
            //lowerLegMaxX = serializedObject.FindProperty("lowerLeg.bone.maxAngles.x");
        }
Example #4
0
 public static float LimitKneeAngle(FootTarget.TargetedLowerLegBone lowerLeg, float angle)
 {
     return(UnityAngles.Clamp(angle, 0, lowerLeg.bone.maxAngle));
 }