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

基于数据绑定方式做动效方便吗? #52

Closed
Drecik opened this issue Nov 7, 2024 · 1 comment
Closed

基于数据绑定方式做动效方便吗? #52

Drecik opened this issue Nov 7, 2024 · 1 comment

Comments

@Drecik
Copy link

Drecik commented Nov 7, 2024

数据绑定了之后做动效方便吗?
比如头顶上的金币栏,绑定的model层的金币从10变成了20,需要播放金币飞入,数字变化动画
比如任务完成之后,任务列表里面需要播放任务完成及删除动画(或者刷新动画)

这种情况下怎么做比较好?

@vovgou
Copy link
Owner

vovgou commented Nov 8, 2024

你这属于视图控件的逻辑,你做一个数字滚动动画的UI控件就好了(不做控件随便写个动画脚本也行),数据绑定后,一但金币值变化你的控件就会收到新的值,这时候你播放滚动动画就行。

你也可以参考图片精灵异步加载,异步刷新的方式,道理是一样的。

@vovgou vovgou closed this as completed Nov 10, 2024
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

2 participants