public static void DrawBodyParts(Rect rect, int shownBodyView, AvatarControl.BodyPartFeedback bodyPartCallback) { GUI.color = new Color(0.2f, 0.2f, 0.2f, 1f); if (AvatarControl.styles.Silhouettes[shownBodyView] != null) { GUI.DrawTexture(rect, AvatarControl.styles.Silhouettes[shownBodyView].image); } for (int i = 1; i < 9; ++i) { AvatarControl.DrawBodyPart(shownBodyView, i, rect, bodyPartCallback((BodyPart)i)); } }
public static int ShowBoneMapping(int shownBodyView, AvatarControl.BodyPartFeedback bodyPartCallback, AvatarSetupTool.BoneWrapper[] bones, SerializedObject serializedObject, AvatarMappingEditor editor) { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); if (AvatarControl.styles.Silhouettes[shownBodyView].image) { Rect rect = GUILayoutUtility.GetRect(AvatarControl.styles.Silhouettes[shownBodyView], GUIStyle.none, new GUILayoutOption[] { GUILayout.MaxWidth((float)AvatarControl.styles.Silhouettes[shownBodyView].image.width) }); AvatarControl.DrawBodyParts(rect, shownBodyView, bodyPartCallback); for (int i = 0; i < bones.Length; i++) { AvatarControl.DrawBone(shownBodyView, i, rect, bones[i], serializedObject, editor); } } else { GUILayout.Label("texture missing,\nfix me!", new GUILayoutOption[0]); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); Rect lastRect = GUILayoutUtility.GetLastRect(); string[] array = new string[] { "Body", "Head", "Left Hand", "Right Hand" }; lastRect.x += 5f; lastRect.width = 70f; lastRect.yMin = lastRect.yMax - 69f; lastRect.height = 16f; for (int j = 0; j < array.Length; j++) { if (GUI.Toggle(lastRect, shownBodyView == j, array[j], EditorStyles.miniButton)) { shownBodyView = j; } lastRect.y += 16f; } return(shownBodyView); }