Commit 7bcf7521 authored by Tt's avatar Tt

bugchuli

parent 295340c7
...@@ -16,6 +16,9 @@ export default class NewClass extends cc.Component { ...@@ -16,6 +16,9 @@ export default class NewClass extends cc.Component {
private txt: cc.Node; private txt: cc.Node;
private right: cc.Node; private right: cc.Node;
private img: cc.Node; private img: cc.Node;
private robotScore: number;
private playerScore: number;
onLoad() { onLoad() {
this.mask = pg.view.find(this, "mask"); this.mask = pg.view.find(this, "mask");
this.penguin = pg.view.find(this.mask, "penguin"); this.penguin = pg.view.find(this.mask, "penguin");
...@@ -29,6 +32,8 @@ export default class NewClass extends cc.Component { ...@@ -29,6 +32,8 @@ export default class NewClass extends cc.Component {
this.img = pg.view.find(this.panel_text, "img"); this.img = pg.view.find(this.panel_text, "img");
let btn_touch = pg.view.find(this, "btn_touch"); let btn_touch = pg.view.find(this, "btn_touch");
pg.view.touchOn(btn_touch, this.onPlayerText, this); pg.view.touchOn(btn_touch, this.onPlayerText, this);
this.robotScore = Game.getIns().robotScore
this.playerScore = Game.getIns().playerScore;
} }
private data: any; private data: any;
...@@ -81,6 +86,8 @@ export default class NewClass extends cc.Component { ...@@ -81,6 +86,8 @@ export default class NewClass extends cc.Component {
this.scheduleOnce(() => { this.scheduleOnce(() => {
if (this.touched) return; if (this.touched) return;
if (Game.getIns().pause) return; if (Game.getIns().pause) return;
if (this.robotScore != Game.getIns().robotScore) return;
if (this.playerScore != Game.getIns().playerScore) return;
Game.getIns().isRobot = true; Game.getIns().isRobot = true;
this.onTouchText(); this.onTouchText();
}, time); }, time);
......
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