|
@@ -1,6 +1,7 @@
|
|
|
import { _decorator, assetManager, Component, Node, Prefab } from 'cc';
|
|
|
import { resLoader } from '../../core_tgx/base/ResLoader';
|
|
|
import { ResourcePool } from './ResourcePool';
|
|
|
+import { LevelManager } from './Manager/LevelMgr';
|
|
|
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
@@ -38,12 +39,6 @@ export class TakeGobletGlobalInstance {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- /** 生成原浆杯高度*/
|
|
|
- public generateOriginCupHeight(): CupHeight {
|
|
|
- //DOTO 配置中获取概率
|
|
|
- return CupHeight.Three;
|
|
|
- }
|
|
|
-
|
|
|
/** 异步加载调酒杯预设*/
|
|
|
async loadAsyncOriginCup(height: CupHeight): Promise<Prefab> {
|
|
|
return new Promise((resolve, reject) => {
|
|
@@ -66,21 +61,28 @@ export class TakeGobletGlobalInstance {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ /** 生成原浆杯高度*/
|
|
|
+ public generateOriginCupHeight(): CupHeight {
|
|
|
+ //DOTO 配置中获取概率
|
|
|
+ return CupHeight.Three;
|
|
|
+ }
|
|
|
+
|
|
|
public levels: Node = null;
|
|
|
|
|
|
- // 初始化调酒杯配置
|
|
|
getInitialCupsConfig(): { height: CupHeight; count: number }[] {
|
|
|
+ const { levelConfig } = LevelManager.instance.levelModel;
|
|
|
+ const wineglass = levelConfig.wineglass;
|
|
|
return [
|
|
|
- { height: CupHeight.Two, count: 3 },
|
|
|
- { height: CupHeight.Three, count: 5 },
|
|
|
- { height: CupHeight.Four, count: 7 }
|
|
|
+ { height: CupHeight.Two, count: wineglass[0] },
|
|
|
+ { height: CupHeight.Three, count: wineglass[1] },
|
|
|
+ { height: CupHeight.Four, count: wineglass[2] }
|
|
|
];
|
|
|
}
|
|
|
|
|
|
- // 生成随机颜色数组
|
|
|
- public getRandomColor(): WaterColors {
|
|
|
- const colors = Object.values(WaterColors).filter(v => !isNaN(Number(v))) as WaterColors[];
|
|
|
- return colors[Math.floor(Math.random() * colors.length)];
|
|
|
+ //获取调酒杯规则
|
|
|
+ cocktailCupRule(): number[] {
|
|
|
+ const { wineglass_color } = LevelManager.instance.levelModel.levelConfig;
|
|
|
+ return wineglass_color;
|
|
|
}
|
|
|
}
|
|
|
|