|
@@ -4,6 +4,7 @@ import { Water } from './Water';
|
|
|
import { EventDispatcher } from 'db://assets/core_tgx/easy_ui_framework/EventDispatcher';
|
|
|
import { GameEvent } from '../Enum/GameEvent';
|
|
|
import { OutArea } from './OutArea';
|
|
|
+import { GameUtil } from '../GameUtil';
|
|
|
const { ccclass, property, executeInEditMode } = _decorator;
|
|
|
|
|
|
/** 调酒杯组件脚本*/
|
|
@@ -112,13 +113,12 @@ export class CocktailCup extends Component {
|
|
|
tween(this.node)
|
|
|
.to(0.3, { scale: Vec3.ZERO })
|
|
|
.call(async () => {
|
|
|
- // 先触发排列再销毁
|
|
|
const outArea = this.node.parent?.parent?.getComponent(OutArea);
|
|
|
if (outArea) {
|
|
|
this.node.removeFromParent(); // 先从父节点移除
|
|
|
+ this.node.destroy();
|
|
|
await outArea.arrangeCups(); // 等待排列完成
|
|
|
}
|
|
|
- this.node.destroy(); // 最后销毁节点
|
|
|
resolve();
|
|
|
})
|
|
|
.start();
|