|
@@ -85,6 +85,8 @@ export class RoosterMoveCar extends Component {
|
|
|
CarColorsGlobalInstance.instance.carSysterm.clearAll();
|
|
|
const { level } = LevelManager.instance.levelModel;
|
|
|
LevelManager.instance.loadLevel(level);
|
|
|
+
|
|
|
+ this.updateScrewsLen();
|
|
|
}
|
|
|
|
|
|
private onClickSet(): void {
|
|
@@ -203,6 +205,11 @@ export class RoosterMoveCar extends Component {
|
|
|
}
|
|
|
|
|
|
onUpdateLeftNail() {
|
|
|
+ this.updateScrewsLen();
|
|
|
+ this.onUpdateLvl();
|
|
|
+ }
|
|
|
+
|
|
|
+ updateScrewsLen() {
|
|
|
const levels = find('Canvas/Scene/Levels')!;
|
|
|
const lbScrews = find('Canvas/GameUI/Pai/LbScrews')!.getComponent(Label);
|
|
|
const children = levels.children;
|
|
@@ -211,9 +218,8 @@ export class RoosterMoveCar extends Component {
|
|
|
|
|
|
const levelComp = children[0].getComponent(LevelAction)!;
|
|
|
const pins = levelComp.get_pin_color();
|
|
|
+ console.log(`钉子数量:${pins.length}`)
|
|
|
lbScrews.string = `${pins.length}`;
|
|
|
-
|
|
|
- this.onUpdateLvl();
|
|
|
}
|
|
|
|
|
|
onUpdateLvl() {
|