FangKuaiItem.ts 840 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { _decorator, Component, Node, sp, Sprite } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('FangKuaiItem')
  4. export class FangKuaiItem extends Component {
  5. @property(sp.Skeleton)
  6. dongwu: sp.Skeleton = null;
  7. @property(Sprite)
  8. cuowu: Sprite = null;
  9. start() {
  10. }
  11. public initSkin(data: sp.SkeletonData) {
  12. this.dongwu.skeletonData = data;
  13. this.dongwu.setAnimation(0, "animation", true);
  14. this.cuowu.node.active = false;
  15. }
  16. public hideDongwu() {
  17. this.dongwu.node.active = false;
  18. }
  19. public showDongWu() {
  20. this.dongwu.node.active = true;
  21. }
  22. public showCha() {
  23. this.cuowu.node.active = true;
  24. setTimeout(() => {
  25. this.cuowu.node.active = false;
  26. }, 1300);
  27. }
  28. update(deltaTime: number) {
  29. }
  30. }