BlueGit

blue-star ggj-2020

Files

ggj-2020 / Assets / Oculus / Avatar / Samples / GripPoses / Scripts / PoseEditHelper.cs

PoseEditHelper.cs

Project Import
timfa Tim Falken · pushed by timfa · 6 years ago
b77834a1 History
PoseEditHelper.cs 724 B Download Raw
1using UnityEngine;
2using System.Collections;
3using System;
4
5public 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}