统一spine中 setAnimation 和 addAnimation 方法的结构. #18549
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
非缓存模式下 , setAnimation 和 addAnimation 方法
除了 最终调用的 spine底层方法不一样之外, 其他的逻辑 应该完全一致.
这个 commit 的目的就是 统一两者的结构 :
两者应该用同样的方式来判断 animation是否存在 并且给与同样的提示
因为在判断 animation 是否存在时, 也判断了 this._skeleton 的有效性, 所以后面不用再做相关判断.
经过测试, setAnimation 和 addAnimation 统一使用 this.state 下的相关方法是更好的选择.更新: 因为需要
_animState->apply(*_skeleton)
, 所以暂时不能用 state.setAnimationWith()setAnimation() 中的
this._markForUpdateRenderData()
是多余的, 因为spine在update 时, 会调用这个方法.Re: #
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: