Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnimationState. timeScale 对于子骨架无效 #137

Open
finscn opened this issue Apr 18, 2020 · 2 comments
Open

AnimationState. timeScale 对于子骨架无效 #137

finscn opened this issue Apr 18, 2020 · 2 comments

Comments

@finscn
Copy link

finscn commented Apr 18, 2020

当动画存在子骨架时, AnimationState的 timeScale并不能正常控制子骨架.

我测试的用例结构是 主骨骼动画的某个插槽上插入了一个帧动画.

用下列代码无效:

state =animation.play(...);
state.timeScale = timeScale;  

上面的代码 会影响 主骨骼动画, 但是 子骨架上的动画还是正常速度播放.

使用下面的代码能实现我想要的效果

state =animation.play(...);
animation.timeScale = timeScale;  

但是这段代码又会在其他方面不符合我的预期.

@finscn
Copy link
Author

finscn commented Apr 18, 2020

看了下源码, 我觉得 AnimationState 也应该和 Animation一样, 增加一个 _inheritTimeScale 属性.
该属性会叠加 AnimationState._parent 的 _inheritTimeScale

@finscn
Copy link
Author

finscn commented Apr 18, 2020

AnimationState._playheadState 也有类似问题.
导致 暂停播放时, 子骨架还在播放.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant