fix: bug 1/4
parent
6caaba5ccf
commit
15bb43a4ca
File diff suppressed because it is too large
Load Diff
|
@ -39,9 +39,6 @@ export class MultiBall extends Component {
|
||||||
ball2.node.setWorldPosition(this._portLeft.worldPosition);
|
ball2.node.setWorldPosition(this._portLeft.worldPosition);
|
||||||
ball2.addForce(new Vec2(-20, 0));
|
ball2.addForce(new Vec2(-20, 0));
|
||||||
|
|
||||||
ball1.playMultiBallEffect();
|
|
||||||
ball2.playMultiBallEffect();
|
|
||||||
|
|
||||||
this._trigged = false;
|
this._trigged = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,10 +173,9 @@ export class GameManager extends Singleton<GameManager>() {
|
||||||
private setCurrentBallInGame(value: number) {
|
private setCurrentBallInGame(value: number) {
|
||||||
this._currentBallInGame += value;
|
this._currentBallInGame += value;
|
||||||
if (this._currentBallInGame >= 2) {
|
if (this._currentBallInGame >= 2) {
|
||||||
if (!this._isMultiBall) {
|
this._isMultiBall = true;
|
||||||
this._isMultiBall = true;
|
EventManger.instance.emit(GameEvent.MultiBall, true);
|
||||||
EventManger.instance.emit(GameEvent.MultiBall, true);
|
this._ballPool.actives.forEach((ball) => ball.getComponent(Ball).playMultiBallEffect());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._currentBallInGame <= 0) {
|
if (this._currentBallInGame <= 0) {
|
||||||
|
|
|
@ -9,7 +9,15 @@ export default class ObjectPool {
|
||||||
private _expandable;
|
private _expandable;
|
||||||
private _poolHandlerComp: new () => any;
|
private _poolHandlerComp: new () => any;
|
||||||
|
|
||||||
private get all() {
|
public get actives() {
|
||||||
|
return [...this._actives];
|
||||||
|
}
|
||||||
|
|
||||||
|
public get inActives() {
|
||||||
|
return [...this._inactive];
|
||||||
|
}
|
||||||
|
|
||||||
|
public get all() {
|
||||||
return [...this._actives, ...this._inactive];
|
return [...this._actives, ...this._inactive];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ export class GameOverPanel extends Component {
|
||||||
|
|
||||||
private _pool: ObjectPool;
|
private _pool: ObjectPool;
|
||||||
private _active = false;
|
private _active = false;
|
||||||
|
private _clicked = false;
|
||||||
|
|
||||||
protected onLoad(): void {
|
protected onLoad(): void {
|
||||||
this._pool = new ObjectPool(this._scorePrefab, 100, true);
|
this._pool = new ObjectPool(this._scorePrefab, 100, true);
|
||||||
|
@ -59,16 +60,21 @@ export class GameOverPanel extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onClickYesButton() {
|
onClickYesButton() {
|
||||||
|
if (this._clicked) return;
|
||||||
|
this._clicked = true;
|
||||||
if (BEConnector.instance.canRelive()) {
|
if (BEConnector.instance.canRelive()) {
|
||||||
BEConnector.instance
|
BEConnector.instance
|
||||||
.checkGameScoreTicket()
|
.checkGameScoreTicket()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
this._clicked = false;
|
||||||
GameManager.instance.gameRelive();
|
GameManager.instance.gameRelive();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
this._clicked = false;
|
||||||
GameManager.instance.gameOver();
|
GameManager.instance.gameOver();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
this._clicked = false;
|
||||||
BEConnector.instance.postMessage();
|
BEConnector.instance.postMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue