-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
spine隐藏时调用setAnimation报错 #17038
Comments
@kaxifakl setAnimation先改成 在node.active=true后面,这个问题后面会修复 |
哪个版本会修复? |
@bofeng-song 这个问题还有后续吗 |
385处理 |
@bofeng-song 这个操作只是不让它报错,在未激活前setAnimation还是无效的。是否有一些缓存机制让animationName缓存下来呢? |
|
@bofeng-song 那这时候是否可以直接用缓存的animationName赋值呢,并且验证一下animationName是否有效 |
@kaxifakl setSkeletonData 接口正常只做和skeletonData有关的事情,不应该顺带执行setAnimation,这样会职责不清晰 |
@bofeng-song 这里的问题应该是,skeleton组件未激活前,手动赋值了SkeletonData,但__preload()方法未执行,所以this._skeleton为空,此时setAnimation, 会在这里被return |
@bofeng-song https://github.com/cocos/cocos-engine/issues/17784 这个issue也是同样的问题,SkeletonData赋值后,setAnimation应该设计为可以被成功调用,即使节点未被激活 |
@kaxifakl |
Cocos Creator version
3.8.3
System information
Window 10
Issue description
1.节点一开始active=false,调用setAnimation播放动画,此时会报错
2.手动调用skeleton初始化,此时不会报错,但动画不会播放
Relevant error log output
No response
Steps to reproduce
打开上传的项目,运行
scene
场景Minimal reproduction project
NewProject_383.zip
The text was updated successfully, but these errors were encountered: