// Draws the custom inspector for IKSolverFullBodybiped public static void AddInspector(SerializedProperty prop, bool editHierarchy, bool editWeights) { IKSolverFullBodyInspector.AddInspector(prop, editHierarchy, editWeights); EditorGUILayout.Space(); EditorGUI.indentLevel = 0; AddSolver(prop); }
/* * Draws the custom inspector for IKSolverFullBodybiped * */ public static void AddInspector(SerializedProperty prop, bool editHierarchy, bool editWeights, SerializedContent[] content) { IKSolverFullBodyInspector.AddInspector(prop, editHierarchy, editWeights, content); // Spine Iteration AddClampedInt(content[content.Length - 3].prop.FindPropertyRelative("iterations"), new GUIContent("Spine Mapping Iterations", "Iterations of FABRIK solver mapping the spine to the FBIK nodes."), 1, 10); // Spine Stiffness AddClampedFloat(content[content.Length - 6]); // Pull Body AddClampedFloat(content[content.Length - 1], -1f, 1f); AddClampedFloat(content[content.Length - 7], -1f, 1f); // Chain EditorGUILayout.Space(); EditorGUI.indentLevel = 0; EditorGUILayout.PropertyField(content[4].prop, new GUIContent("Chain", "The node chain.")); if (content[4].prop.isExpanded) { AddPulls(content[4].prop); EditorGUILayout.Space(); } // Effectors EditorGUI.indentLevel = 0; EditorGUILayout.PropertyField(content[2].prop, new GUIContent("Effectors", "Effectors for manipulating the node chain.")); if (content[2].prop.isExpanded) { // Body AddEffector(content[2].prop.GetArrayElementAtIndex(0), new GUIContent("Body"), false); // Left Shoulder AddEffector(content[2].prop.GetArrayElementAtIndex(1), new GUIContent("L Shoulder"), false); // Right Shoulder AddEffector(content[2].prop.GetArrayElementAtIndex(2), new GUIContent("R Shoulder"), false); // Left Thigh AddEffector(content[2].prop.GetArrayElementAtIndex(3), new GUIContent("L Thigh"), false); // Right Thigh AddEffector(content[2].prop.GetArrayElementAtIndex(4), new GUIContent("R Thigh"), false); // Left Hand AddEffector(content[2].prop.GetArrayElementAtIndex(5), new GUIContent("L Hand")); // Right Hand AddEffector(content[2].prop.GetArrayElementAtIndex(6), new GUIContent("R Hand")); // Left Foot AddEffector(content[2].prop.GetArrayElementAtIndex(7), new GUIContent("L Foot")); // Right Foot AddEffector(content[2].prop.GetArrayElementAtIndex(8), new GUIContent("R Foot")); EditorGUILayout.Space(); } EditorGUI.indentLevel = 0; // Mappings EditorGUILayout.PropertyField(content[content.Length - 3].prop, new GUIContent("Mapping", "Options for mapping bones to their solver positions.")); if (content[content.Length - 3].prop.isExpanded) { AddSpineMapping(content[content.Length - 3].prop, new GUIContent("Spine")); AddMapping(content[content.Length - 2].prop.GetArrayElementAtIndex(0), new GUIContent("Left Hand")); AddMapping(content[content.Length - 2].prop.GetArrayElementAtIndex(1), new GUIContent("Right Hand")); AddMapping(content[content.Length - 2].prop.GetArrayElementAtIndex(2), new GUIContent("Left Foot")); AddMapping(content[content.Length - 2].prop.GetArrayElementAtIndex(3), new GUIContent("Right Foot")); AddMapping(content[content.Length - 4].prop.GetArrayElementAtIndex(0), new GUIContent("Head")); } }