动画效果:

      cocos creator

 如图在场景中创建一个空节点,点击添加Animatiion

cocos creator

cocos creator

cocos creator

选中要改变的属性。(以spriteFrame为例)

cocos creator

 

将选中的图片拖动到所示位置,此时点击播放按钮即可预览。

保存之后将层级管理器中的节点拖动到资源管理器中,生成预制体,即可在各个场景中使用。

 

程序中控制动画播放:

  var  变量 =  节点.getComponent("cc.Animation");

  变量.play("动画名", 0);

相关文章:

  • 2022-12-23
  • 2021-07-08
  • 2021-11-25
  • 2021-05-23
  • 2021-07-16
  • 2021-08-15
  • 2021-09-20
  • 2021-10-18
猜你喜欢
  • 2021-11-21
  • 2021-08-22
  • 2021-10-01
  • 2021-06-23
  • 2021-05-15
  • 2021-08-24
  • 2021-11-11
相关资源
相似解决方案