| 1 | using UnityEngine; |
| 2 | using System.Collections; |
| 3 | using System; |
| 4 | |
| 5 | public class PoseEditHelper : MonoBehaviour { |
| 6 | |
| 7 | public Transform poseRoot; |
| 8 | |
| 9 | void OnDrawGizmos() |
| 10 | { |
| 11 | if (poseRoot != null) |
| 12 | { |
| 13 | DrawJoints(poseRoot); |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | private void DrawJoints(Transform joint) |
| 18 | { |
| 19 | Gizmos.DrawWireSphere(joint.position, 0.005f); |
| 20 | for (int i = 0; i < joint.childCount; ++i) |
| 21 | { |
| 22 | Transform child = joint.GetChild(i); |
| 23 | if (child.name.EndsWith("_grip") || child.name.EndsWith("hand_ignore")) |
| 24 | { |
| 25 | continue; |
| 26 | } |
| 27 | Gizmos.DrawLine(joint.position, child.position); |
| 28 | DrawJoints(child); |
| 29 | } |
| 30 | } |
| 31 | } |