浏览代码

AnimationObjectGroup: Fix uncache() when used with a single object.

Mugen87 4 年之前
父节点
当前提交
8295b0ea5f
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/animation/AnimationObjectGroup.js

+ 6 - 1
src/animation/AnimationObjectGroup.js

@@ -281,7 +281,12 @@ Object.assign( AnimationObjectGroup.prototype, {
 					const lastIndex = -- nObjects,
 						lastObject = objects[ lastIndex ];
 
-					indicesByUUID[ lastObject.uuid ] = index;
+					if ( lastIndex > 0 ) {
+
+						indicesByUUID[ lastObject.uuid ] = index;
+
+					}
+
 					objects[ index ] = lastObject;
 					objects.pop();