|
@@ -310,6 +310,7 @@ export class LevelAction extends Component {
|
|
const waitCups = this.waitArea.cups;
|
|
const waitCups = this.waitArea.cups;
|
|
const outCups = this.outArea.getCups();
|
|
const outCups = this.outArea.getCups();
|
|
const needAddCount = outCups.length === 0 ? 2 : 1;
|
|
const needAddCount = outCups.length === 0 ? 2 : 1;
|
|
|
|
+ const byX = outCups.length === 0 ? 160 : 80;
|
|
|
|
|
|
const movingCups: Node[] = [];
|
|
const movingCups: Node[] = [];
|
|
for (let i = 0; i < needAddCount; i++) {
|
|
for (let i = 0; i < needAddCount; i++) {
|
|
@@ -328,8 +329,8 @@ export class LevelAction extends Component {
|
|
newComp.reset();
|
|
newComp.reset();
|
|
|
|
|
|
const targetX = outCups.length === 0 ?
|
|
const targetX = outCups.length === 0 ?
|
|
- (newCups.length === 0 ? -125 : -45) :
|
|
|
|
- -45;
|
|
|
|
|
|
+ (newCups.length === 0 ? -120 : -40) :
|
|
|
|
+ -40;
|
|
newCup.setPosition(new Vec3(targetX, 0, 0));
|
|
newCup.setPosition(new Vec3(targetX, 0, 0));
|
|
|
|
|
|
newCups.push(newCup);
|
|
newCups.push(newCup);
|
|
@@ -343,13 +344,9 @@ export class LevelAction extends Component {
|
|
if (this.waitArea.getCups().length > 0) {
|
|
if (this.waitArea.getCups().length > 0) {
|
|
this.outArea.getCups().concat(this.waitArea.getCups()).forEach(cup => {
|
|
this.outArea.getCups().concat(this.waitArea.getCups()).forEach(cup => {
|
|
tween(cup)
|
|
tween(cup)
|
|
- .by(0.3, { position: new Vec3(80, 0, 0) }, { easing: 'sineOut' })
|
|
|
|
|
|
+ .by(0.3, { position: new Vec3(byX, 0, 0) }, { easing: 'sineOut' })
|
|
.start();
|
|
.start();
|
|
});
|
|
});
|
|
-
|
|
|
|
- //重新排列次
|
|
|
|
- this.waitArea.arrangeCups();
|
|
|
|
- this.outArea.arrangeCups();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// 在添加完成后处理暂存区倒水
|
|
// 在添加完成后处理暂存区倒水
|