Commit d6029cfb authored by haiyoucuv's avatar haiyoucuv

init

parent bde121dc
......@@ -31,8 +31,8 @@ export class ReviewPanel extends Panel {
this.cancelBtn.on(Button.EventType.CLICK, this.cancel, this);
this.closeBtn.on(Button.EventType.CLICK, this.cancel, this);
const parkPoints = MainGame.ins.parkPoints.children;
if (parkPoints[4].name == "lock") {
const lockIndex = MainGame.ins.getLockPoints();
if (lockIndex == 4) {
if (gameStore.startInfo.shareUnlocked) {
this.type = "green";
} else {
......@@ -59,15 +59,16 @@ export class ReviewPanel extends Panel {
}
}
cancel = _asyncThrottle(() => {
cancel = _asyncThrottle(async () => {
this.hidePanel();
AudioMgr.ins.playOneShot(AudioClipName.button_ok);
gameStore.submit(false);
await gameStore.submit(false);
})
ok = _asyncThrottle(async () => {
const { type } = this.data;
AudioMgr.ins.playOneShot(AudioClipName.button_ok);
const lockIndex = MainGame.ins.getLockPoints();
if (type == "share") {
showShareGuide();
this.scheduleOnce(() => {
......@@ -78,9 +79,11 @@ export class ReviewPanel extends Panel {
MainGame.ins.unlockPoint(4);
}, 2.5);
} else {
const suc = await gameStore.unlockPark(type);
if (!suc) return;
this.hidePanel();
MainGame.ins.unlockPoint(lockIndex);
}
})
}
......
......@@ -83,8 +83,20 @@ export class MainGame extends Scene {
});
}
getLockPoints() {
const points = this.parkPoints.children;
if (points[4].name == "lock") {
return 4;
} else if (points[5].name == "lock") {
return 5;
} else if (points[6].name == "lock") {
return 6;
}
return null;
}
unlockPoint(index: number) {
const points = find("Scene/Parkings").children;
const points = this.parkPoints.children;
points[index].name = "empty";
points[index].children[0].children[0].active = true;
points[index].children[0].children[1].active = false;
......
......@@ -19,6 +19,8 @@ import { showPanel } from "db://assets/core/Module/UIFast";
import { ReviewPanel } from "db://assets/Scripts/Panels/ReviewPanel";
import { CarColors, CarTypes } from "db://assets/Scripts/Scenes/MainGame/CarColorsGlobalTypes";
import { CarColorsGlobalInstance } from "db://assets/Scripts/Scenes/MainGame/CarColorsGlobalInstance";
import { MainGame } from "db://assets/Scripts/Scenes/MainGame/MainGame";
import gameStore from "db://assets/Scripts/store/gameStore";
const { ccclass, property } = _decorator;
......@@ -199,7 +201,12 @@ export class RoleCarColorsSysterm extends Component {
// 游戏结束判定
if (!isEmpty) {
this.isGaming = false
showPanel(ReviewPanel);
const lockIndex = MainGame.ins.getLockPoints();
if (!lockIndex) {
gameStore.submit(false);
} else {
showPanel(ReviewPanel);
}
}
return
}
......
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