Commit 8dc24976 authored by Vũ Gia Vương's avatar Vũ Gia Vương

fix relay

parent e42f321e
......@@ -2122,6 +2122,7 @@
]
}
}
}
},
"default":{}
}
}
\ No newline at end of file
......@@ -4,4 +4,5 @@ export const SHOW_ACTION_SCREEN = 'SHOW_ACTION_SCREEN';
export const SHOW_START_SCREEN = 'SHOW_START_SCREEN';
export const SHOW_CARD_POPUP = 'SHOW_CARD_POPUP';
export const STOP_ANIM_CHUM = 'STOP_ANIM_CHUM';
export const SHOW_SELECT_POPUP = 'SHOW_SELECT_POPUP';
\ No newline at end of file
......@@ -28,7 +28,6 @@ export default class BuaController extends cc.Component {
}
public onSetTool() {
console.log('onSetTool', )
this.spine.setSkin(this._skins[Global.tool % this._skins.length])
}
......
import { eventTarget, SHOW_ACTION_SCREEN } from "../Events";
import { eventTarget, SHOW_ACTION_SCREEN, STOP_ANIM_CHUM } from "../Events";
const { ccclass, property } = cc._decorator;
......@@ -15,6 +15,7 @@ export default class ChumController extends cc.Component {
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this._actions = [this.playAnimationNut1, this.playAnimationNut2, this.playAnimationNut3, this.playAnimationNut4];
eventTarget.on(STOP_ANIM_CHUM, this.stopAnimation, this);
}
private onTouchStart(): void {
......@@ -22,6 +23,10 @@ export default class ChumController extends cc.Component {
// this._count = (this._count + 1) % this._actions.length;
}
private stopAnimation(): void {
this.spine.setAnimation(0, "default", true);
}
public playAnimationNut1(): void {
this.spine.setAnimation(0, "nut1", true);
this.spine.timeScale = 1;
......
import { eventTarget, SHOW_CARD_POPUP } from "../Events";
import { eventTarget, SHOW_CARD_POPUP, STOP_ANIM_CHUM } from "../Events";
const { ccclass, property } = cc._decorator;
......@@ -25,5 +25,6 @@ export default class CardPopup extends cc.Component {
private onReplayBtnClick() {
this.node.active = false;
eventTarget.emit(STOP_ANIM_CHUM);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment