1234567891011121314151617181920212223242526272829303132333435363738 |
- import { _decorator, Component, Node, sp, Sprite } from 'cc';
- const { ccclass, property } = _decorator;
- @ccclass('FangKuaiItem')
- export class FangKuaiItem extends Component {
- @property(sp.Skeleton)
- dongwu: sp.Skeleton = null;
- @property(Sprite)
- cuowu: Sprite = null;
- start() {
- }
- public initSkin(data: sp.SkeletonData) {
- this.dongwu.skeletonData = data;
- this.dongwu.setAnimation(0, "animation", true);
- this.cuowu.node.active = false;
- }
- public hideDongwu() {
- this.dongwu.node.active = false;
- }
- public showDongWu() {
- this.dongwu.node.active = true;
- }
- public showCha() {
- this.cuowu.node.active = true;
- setTimeout(() => {
- this.cuowu.node.active = false;
- }, 1300);
- }
- update(deltaTime: number) {
- }
- }
|