@@ -26,7 +26,7 @@ public class RTSkeleton : MonoBehaviour
26
26
27
27
private Skeleton mQtmSkeletonCache ;
28
28
#if DEBUG_SKELETON
29
- private GameObject mTPoseRoot ;
29
+ private GameObject mDebugSkeletonTPose ;
30
30
#endif
31
31
void Update ( )
32
32
{
@@ -46,12 +46,8 @@ void Update()
46
46
mStreamedRootObject = new GameObject ( this . SkeletonName ) ;
47
47
48
48
#if DEBUG_SKELETON
49
- if ( mTPoseRoot != null )
50
- GameObject . Destroy ( mTPoseRoot ) ;
51
- mTPoseRoot = new GameObject ( ) ;
52
49
mStreamedRootObject . AddComponent < DebugHierarchyRotations > ( ) . color = Color . yellow ;
53
50
#endif
54
-
55
51
mQTmSegmentIdToGameObject = new Dictionary < uint , GameObject > ( mQtmSkeletonCache . Segments . Count ) ;
56
52
57
53
foreach ( var segment in mQtmSkeletonCache . Segments )
@@ -65,9 +61,11 @@ void Update()
65
61
66
62
mStreamedRootObject . transform . SetParent ( this . transform , false ) ;
67
63
#if DEBUG_SKELETON
68
- mTPoseRoot = GameObject . Instantiate < GameObject > ( mStreamedRootObject . gameObject , this . transform , false ) ;
69
- mTPoseRoot . name = this . SkeletonName + "-TPose" ;
70
- mTPoseRoot . GetComponent < DebugHierarchyRotations > ( ) . color = Color . white ;
64
+ if ( mDebugSkeletonTPose != null )
65
+ GameObject . Destroy ( mDebugSkeletonTPose ) ;
66
+ mDebugSkeletonTPose = GameObject . Instantiate < GameObject > ( mStreamedRootObject . gameObject , this . transform , false ) ;
67
+ mDebugSkeletonTPose . name = this . SkeletonName + "-TPose" ;
68
+ mDebugSkeletonTPose . GetComponent < DebugHierarchyRotations > ( ) . color = Color . white ;
71
69
#endif
72
70
BuildMecanimAvatarFromQtmTPose ( ) ;
73
71
0 commit comments