public static void LinkBodyPointReprs(BodySearchEngine source, BodyModel body, bool includeHands) { // Torso LinkPointRepr(source.body.hipsPoint, body.torso.hips.point, false); LinkPointRepr(source.body.spinePoint, body.torso.spine.point, false); LinkPointRepr(source.body.chestPoint, body.torso.chest.point, false); LinkPointRepr(source.body.neckPoint, body.torso.neck.point, false); LinkPointRepr(source.body.headPoint, body.torso.head.point, false); LinkPointRepr(source.body.eyesPoint, body.torso.eyes, false); LinkPointRepr(source.body.headTopPoint, body.torso.headTop, false); // Left arm LinkPointRepr(source.body.leftShoulderPoint, body.leftArm.shoulder.point, false); LinkPointRepr(source.body.leftUpperArmPoint, body.leftArm.upper.point, false); LinkPointRepr(source.body.leftForearmPoint, body.leftArm.forearm.point, false); if (includeHands) { LinkPointRepr(source.body.leftHandPoint, body.leftArm.hand.wrist.point, true); } // Right arm LinkPointRepr(source.body.rightShoulderPoint, body.rightArm.shoulder.point, false); LinkPointRepr(source.body.rightUpperArmPoint, body.rightArm.upper.point, false); LinkPointRepr(source.body.rightForearmPoint, body.rightArm.forearm.point, false); if (includeHands) { LinkPointRepr(source.body.rightHandPoint, body.rightArm.hand.wrist.point, true); } // Left leg LinkPointRepr(source.body.leftThighPoint, body.leftLeg.thigh.point, false); LinkPointRepr(source.body.leftCalfPoint, body.leftLeg.calf.point, false); LinkPointRepr(source.body.leftFootPoint, body.leftLeg.foot.point, false); LinkPointRepr(source.body.leftToesPoint, body.leftLeg.toes, false); // Right leg LinkPointRepr(source.body.rightThighPoint, body.rightLeg.thigh.point, false); LinkPointRepr(source.body.rightCalfPoint, body.rightLeg.calf.point, false); LinkPointRepr(source.body.rightFootPoint, body.rightLeg.foot.point, false); LinkPointRepr(source.body.rightToesPoint, body.rightLeg.toes, false); }
public override void OnInspectorGUI() { // base.OnInspectorGUI(); // DrawDefaultInspector(); BodySearchEngine myScript = (BodySearchEngine)target; GUILayout.Label("Body", EditorStyles.boldLabel); OriginalField(myScript.body.hipsPoint, "Hips"); OriginalField(myScript.body.spinePoint, "Spine"); OriginalField(myScript.body.chestPoint, "Chest"); OriginalField(myScript.body.neckPoint, "Neck"); OriginalField(myScript.body.headPoint, "Head"); OriginalField(myScript.body.eyesPoint, "Eyes"); OriginalField(myScript.body.headTopPoint, "Head Top"); OriginalField(myScript.body.leftShoulderPoint, "Left Shoulder"); OriginalField(myScript.body.leftUpperArmPoint, "Left Upper Arm"); OriginalField(myScript.body.leftForearmPoint, "Left Forearm"); OriginalField(myScript.body.leftHandPoint, "Left Hand Wrist"); OriginalField(myScript.body.rightShoulderPoint, "Right Shoulder"); OriginalField(myScript.body.rightUpperArmPoint, "Right Upper Arm"); OriginalField(myScript.body.rightForearmPoint, "Right Forearm"); OriginalField(myScript.body.rightHandPoint, "Right Hand Wrist"); OriginalField(myScript.body.leftThighPoint, "Left Thigh"); OriginalField(myScript.body.leftCalfPoint, "Left Calf"); OriginalField(myScript.body.leftFootPoint, "Left Foot"); OriginalField(myScript.body.leftToesPoint, "Left Toes"); OriginalField(myScript.body.rightThighPoint, "Right Thigh"); OriginalField(myScript.body.rightCalfPoint, "Right Calf"); OriginalField(myScript.body.rightFootPoint, "Right Foot"); OriginalField(myScript.body.rightToesPoint, "Right Toes"); myScript.AutoFill(); EditorGUILayout.PropertyField(szdBones); GUILayout.Label("Debug", EditorStyles.boldLabel); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Show Gizmos"); myScript.showGizmos = EditorGUILayout.Toggle(myScript.showGizmos); EditorGUILayout.EndHorizontal(); EditorGUILayout.PropertyField(szdBody); GUI.enabled = myScript.canSearch; if (GUILayout.Button("SEARCH BONES")) { myScript.Search(); } GUI.enabled = true; }