StandCat.js 508 B

1234567891011121314151617181920212223242526
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. catNode: cc.Node,
  5. catSkeleton: sp.Skeleton,
  6. },
  7. // LIFE-CYCLE CALLBACKS:
  8. onLoad() {
  9. this.catNode.on(cc.Node.EventType.TOUCH_START, () => {
  10. this.catSkeleton.setAnimation(0, 'hit', false);
  11. this.catSkeleton.setCompleteListener(() => {
  12. this.catSkeleton.setAnimation(0, 'stand', true);
  13. });
  14. }, this);
  15. },
  16. start() {
  17. },
  18. // update (dt) {},
  19. });