mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 09:32:38 +08:00
Timeline should retain all scene objects by using uuids to avoid reference lost after scene reloaded (#3005)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user