Commit 5fabb20b authored by Vũ Gia Vương's avatar Vũ Gia Vương

update BreakingBottleScreen

parent 417b3c67
This diff is collapsed.
......@@ -22,9 +22,9 @@ export default class BreakingBottleController extends cc.Component {
this._cardNode = this.node.getComponentInChildren(TheController).node;
this._cardNode.active = false;
this.node.position = cc.v3(0, 0);
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this.node.on(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this);
eventTarget.on(CHECK_FRAGMENT, this.checkFragment, this);
eventTarget.on(HAMMER, this.onHammer, this);
}
......
......@@ -16,6 +16,7 @@ export default class FragmentController extends cc.Component {
this._physicsCollider.points = this._collider.points;
this._physicsCollider.enabled = false;
this._rg = this.node.getComponent(cc.RigidBody);
this._rg.type = cc.RigidBodyType.Static;
eventTarget.on(CHECK_TOUCH, this.checkTouch, this);
}
......
import { eventTarget, PLAY_ANIM_NUT1, PLAY_ANIM_NUT2, PLAY_ANIM_NUT3, PLAY_ANIM_NUT4, SHOW_ACTION_SCREEN, SHOW_CARD_POPUP, SHOW_START_SCREEN } from "../Events";
import { eventTarget, PLAY_ANIM_NUT1, PLAY_ANIM_NUT2, PLAY_ANIM_NUT3, PLAY_ANIM_NUT4, SHOW_ACTION_SCREEN, SHOW_START_SCREEN } from "../Events";
import BuaController from "../GamePlay/BuaController";
const { ccclass, property } = cc._decorator;
......@@ -14,6 +14,8 @@ export default class ActionScreen extends cc.Component {
private _spine: sp.Skeleton = null;
onLoad() {
return;
eventTarget.on(SHOW_ACTION_SCREEN, this.showScreen, this);
eventTarget.on(SHOW_START_SCREEN, this.hideScreen, this);
eventTarget.on(PLAY_ANIM_NUT1, this.hideBottle, this);
......
import { eventTarget, SHOW_ACTION_SCREEN, SHOW_START_SCREEN } from "../Events";
const { ccclass, property } = cc._decorator;
@ccclass
export default class BreakingBottleScreen extends cc.Component {
onLoad() {
eventTarget.on(SHOW_ACTION_SCREEN, this.showScreen, this);
eventTarget.on(SHOW_START_SCREEN, this.hideScreen, this);
// this.node.position = cc.v3(400, 600, 0);
}
private hideBottle() {
// this.bottleAction.active = true;
// this.bottleIdle.active = false;
}
private showScreen() {
console.log('showScreen', this.node)
// this.bottleAction.active = false;
// this.bottleIdle.active = true;
// this._spine.setAnimation(0, 'Idle', true);
// this._buaController.onSetTool();
this.node.active = true;
this.node.position = cc.v3();
}
private hideScreen() {
this.node.active = false;
}
}
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