Timeline should retain all scene objects by using uuids to avoid reference lost after scene reloaded (#3005)

This commit is contained in:
Jare Guo
2018-07-24 21:52:21 +08:00
committed by pandamicro
parent 5fcc88ada2
commit 82969a85d3
+11 -5
View File
@@ -274,15 +274,21 @@ function refreshScene () {
animationState.previewing = nowPreviewing;
if (nowPreviewing) {
animationState.animatedSinceLastFrame = true;
animationState.time = AnimUtils.Cache.animation.time;
let component = cc.engine.getInstanceById(AnimUtils.Cache.component);
let animation = component.getAnimationState(AnimUtils.Cache.animation);
animationState.time = animation.time;
}
else {
animationState.animatedSinceLastFrame = false;
}
}
else if (nowPreviewing && animationState.time !== AnimUtils.Cache.animation.time) {
animationState.animatedSinceLastFrame = true;
animationState.time = AnimUtils.Cache.animation.time;
else if (nowPreviewing) {
let component = cc.engine.getInstanceById(AnimUtils.Cache.component);
let animation = component.getAnimationState(AnimUtils.Cache.animation);
if (animationState.time !== animation.time) {
animationState.animatedSinceLastFrame = true;
animationState.time = AnimUtils.Cache.animation.time;
}
}
}
}
@@ -301,7 +307,7 @@ function refreshScene () {
if (CC_EDITOR &&
(AnimUtils = Editor.require('scene://utils/animation')) &&
AnimUtils.Cache.animation) {
var editingNode = AnimUtils.Cache.rNode;
var editingNode = cc.engine.getInstanceById(AnimUtils.Cache.rNode);
for (i = activeWidgets.length - 1; i >= 0; i--) {
widget = activeWidgets[i];
var node = widget.node;