|
@@ -38,7 +38,7 @@ export class LevelAction extends Component {
|
|
}
|
|
}
|
|
|
|
|
|
start() {
|
|
start() {
|
|
- this.generateInitialCups();
|
|
|
|
|
|
+ // this.generateInitialCups();
|
|
this.registerListener();
|
|
this.registerListener();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -126,12 +126,12 @@ export class LevelAction extends Component {
|
|
tgxUITips.show('我知道你很急,但你先别急!');
|
|
tgxUITips.show('我知道你很急,但你先别急!');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ const levelModel = LevelManager.instance.levelModel;
|
|
const outCups = this.outArea.getCups() as Node[];
|
|
const outCups = this.outArea.getCups() as Node[];
|
|
const waitCups = this.waitArea.getCups() as Node[];
|
|
const waitCups = this.waitArea.getCups() as Node[];
|
|
|
|
|
|
- // DOTO 取前7个杯子颜色后期修改
|
|
|
|
- const allCups = [...outCups, ...waitCups].slice(0, 7);
|
|
|
|
|
|
+ const measuringcup_number = levelModel.levelConfig.measuringcup_number;
|
|
|
|
+ const allCups = [...outCups, ...waitCups].slice(0, measuringcup_number);
|
|
const colors = allCups.map(cup => {
|
|
const colors = allCups.map(cup => {
|
|
const comp = cup.getComponent(CocktailCup);
|
|
const comp = cup.getComponent(CocktailCup);
|
|
return comp ? comp.cupColor : WaterColors.Blue;
|
|
return comp ? comp.cupColor : WaterColors.Blue;
|
|
@@ -399,8 +399,9 @@ export class LevelAction extends Component {
|
|
}
|
|
}
|
|
|
|
|
|
private async spawnNewOriginCup(targetPos: Vec3) {
|
|
private async spawnNewOriginCup(targetPos: Vec3) {
|
|
- // DOTO 获取颜色配置
|
|
|
|
- const colors = this.getAvailableColors(5); // 获取前5个颜色
|
|
|
|
|
|
+ const levelModel = LevelManager.instance.levelModel;
|
|
|
|
+ const measuringcup_number = levelModel.levelConfig.measuringcup_number;//获取调酒和等待区前面数量
|
|
|
|
+ const colors = this.getAvailableColors(measuringcup_number);
|
|
if (colors.length <= 0) return;
|
|
if (colors.length <= 0) return;
|
|
|
|
|
|
// 创建新原浆杯
|
|
// 创建新原浆杯
|