KaPaiItem.ts 575 B

1234567891011121314151617181920212223242526272829
  1. import { _decorator, Component, Node, sp } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('KaPaiItem')
  4. export class KaPaiItem extends Component {
  5. @property(sp.Skeleton)
  6. dongwu: sp.Skeleton = null;
  7. start() {
  8. }
  9. public initSkin(data:sp.SkeletonData){
  10. this.dongwu.skeletonData = data;
  11. this.dongwu.setAnimation(0,"animation",true);
  12. }
  13. public hideDongwu(){
  14. this.dongwu.node.active = false;
  15. }
  16. public showDongWu(){
  17. this.dongwu.node.active = true;
  18. }
  19. update(deltaTime: number) {
  20. }
  21. }