| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using UnityEngine; |
| | 4 | |
|
| | 5 | | namespace DCL |
| | 6 | | { |
| | 7 | | public static class AvatarBodyPartReferenceUtility |
| | 8 | | { |
| | 9 | | public static Transform GetLeftHand(Transform[] bodyParts) |
| | 10 | | { |
| 0 | 11 | | return GetBodyPart(bodyParts, "Avatar_LeftHand"); |
| | 12 | | } |
| | 13 | |
|
| | 14 | | public static Transform GetRightHand(Transform[] bodyParts) |
| | 15 | | { |
| 0 | 16 | | return GetBodyPart(bodyParts, "Avatar_RightHand"); |
| | 17 | | } |
| | 18 | |
|
| | 19 | | public static Transform GetLeftToe(Transform[] bodyParts) |
| | 20 | | { |
| 0 | 21 | | return GetBodyPart(bodyParts, "Avatar_LeftToeBase"); |
| | 22 | | } |
| | 23 | |
|
| | 24 | | public static Transform GetRightToe(Transform[] bodyParts) |
| | 25 | | { |
| 0 | 26 | | return GetBodyPart(bodyParts, "Avatar_RightToeBase"); |
| | 27 | | } |
| | 28 | |
|
| | 29 | | private static Transform GetBodyPart(Transform[] bodyParts, string name) |
| | 30 | | { |
| 0 | 31 | | for (int i = 0; i < bodyParts.Length; i++) { |
| 0 | 32 | | if (bodyParts[i].name == name) |
| 0 | 33 | | return bodyParts[i]; |
| | 34 | | } |
| 0 | 35 | | return null; |
| | 36 | | } |
| | 37 | | } |
| | 38 | | } |