@@ -2134,6 +2134,10 @@ public struct AnimationOnlyExportData {
2134
2134
// first clip to export
2135
2135
public AnimationClip defaultClip ;
2136
2136
2137
+ // TODO: find a better way to keep track of which components + properties we support
2138
+ private static List < string > cameraProps = new List < string > { "field of view" } ;
2139
+ private static List < string > lightProps = new List < string > { "m_Intensity" , "m_SpotAngle" , "m_Color.r" , "m_Color.g" , "m_Color.b" } ;
2140
+
2137
2141
public AnimationOnlyExportData (
2138
2142
Dictionary < AnimationClip , GameObject > animClips ,
2139
2143
HashSet < GameObject > exportSet ,
@@ -2149,10 +2153,6 @@ public void ComputeObjectsInAnimationClips(
2149
2153
AnimationClip [ ] animClips ,
2150
2154
GameObject animationRootObject
2151
2155
) {
2152
- // TODO: find a better way to keep track of which components + properties we support
2153
- var cameraProps = new List < string > { "field of view" } ;
2154
- var lightProps = new List < string > { "m_Intensity" , "m_SpotAngle" , "m_Color.r" , "m_Color.g" , "m_Color.b" } ;
2155
-
2156
2156
foreach ( var animClip in animClips ) {
2157
2157
if ( this . animationClips . ContainsKey ( animClip ) ) {
2158
2158
// we have already exported gameobjects for this clip
@@ -2282,7 +2282,7 @@ public SkinnedMeshBoneInfo(SkinnedMeshRenderer skinnedMesh, Dictionary<Transform
2282
2282
}
2283
2283
2284
2284
/// <summary>
2285
- /// Exports the Gameobject and it's ancestors.
2285
+ /// Exports the Gameobject and its ancestors.
2286
2286
/// </summary>
2287
2287
/// <returns><c>true</c>, if game object and parents were exported,
2288
2288
/// <c>false</c> if export cancelled.</returns>
@@ -2451,7 +2451,7 @@ private bool ExportBoneTransform(
2451
2451
/// <returns>The object to root count.</returns>
2452
2452
/// <param name="startObject">Start object.</param>
2453
2453
/// <param name="root">Root object.</param>
2454
- private int GetObjectToRootCount ( Transform startObject , Transform root ) {
2454
+ private int GetObjectToRootDepth ( Transform startObject , Transform root ) {
2455
2455
if ( startObject == null ) {
2456
2456
return 0 ;
2457
2457
}
@@ -2495,27 +2495,27 @@ out Dictionary<GameObject, AnimationOnlyExportData> hierarchyToExportData
2495
2495
2496
2496
hierarchyToExportData . Add ( go , exportData ) ;
2497
2497
2498
- int fromRoot = int . MaxValue ;
2498
+ int depthFromRootAnimation = int . MaxValue ;
2499
2499
Animation rootAnimation = null ;
2500
2500
foreach ( var anim in legacyAnim ) {
2501
- int count = GetObjectToRootCount ( anim . transform , go . transform ) ;
2501
+ int count = GetObjectToRootDepth ( anim . transform , go . transform ) ;
2502
2502
2503
- if ( count < fromRoot ) {
2504
- fromRoot = count ;
2503
+ if ( count < depthFromRootAnimation ) {
2504
+ depthFromRootAnimation = count ;
2505
2505
rootAnimation = anim ;
2506
2506
}
2507
2507
2508
2508
var animClips = AnimationUtility . GetAnimationClips ( anim . gameObject ) ;
2509
2509
exportData . ComputeObjectsInAnimationClips ( animClips , anim . gameObject ) ;
2510
2510
}
2511
2511
2512
- int aFromRoot = int . MaxValue ;
2512
+ int depthFromRootAnimator = int . MaxValue ;
2513
2513
Animator rootAnimator = null ;
2514
2514
foreach ( var anim in genericAnim ) {
2515
- int count = GetObjectToRootCount ( anim . transform , go . transform ) ;
2515
+ int count = GetObjectToRootDepth ( anim . transform , go . transform ) ;
2516
2516
2517
- if ( count < aFromRoot ) {
2518
- aFromRoot = count ;
2517
+ if ( count < depthFromRootAnimator ) {
2518
+ depthFromRootAnimator = count ;
2519
2519
rootAnimator = anim ;
2520
2520
}
2521
2521
@@ -2528,7 +2528,7 @@ out Dictionary<GameObject, AnimationOnlyExportData> hierarchyToExportData
2528
2528
}
2529
2529
2530
2530
// set the first clip to export
2531
- if ( fromRoot < aFromRoot ) {
2531
+ if ( depthFromRootAnimation < depthFromRootAnimator ) {
2532
2532
exportData . defaultClip = rootAnimation . clip ;
2533
2533
} else {
2534
2534
// Try the animator controller (mecanim)
0 commit comments