Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
724 B

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