同步主站 Cocos 当前工程:关卡资源、运行脚本与打包工具。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -58,6 +58,12 @@ export class PropController extends Component {
|
||||
this.onCollected(player);
|
||||
}
|
||||
|
||||
/** 同关重开:金币只隐藏不销毁,立刻放回格子,避免异步补刷拖过编辑器 200ms */
|
||||
restoreForRestart() {
|
||||
this.collected = false;
|
||||
if (this.node?.isValid) this.node.active = true;
|
||||
}
|
||||
|
||||
private onCollected(player: PlayerController) {
|
||||
if (this.collected) return;
|
||||
this.collected = true;
|
||||
@@ -66,8 +72,6 @@ export class PropController extends Component {
|
||||
player.addCoins();
|
||||
const propCell = this.getLogicCell();
|
||||
gm.removePropAtCell(propCell);
|
||||
this.node.removeFromParent();
|
||||
this.node.destroy();
|
||||
if (gm.allPropsCollected()) {
|
||||
player.externalCallResult(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user