|
@@ -613,6 +613,28 @@ class Bomb {
|
|
|
|
|
|
// 开始执行第一个灯光动画
|
|
|
playChainAnimations(0);
|
|
|
+
|
|
|
+ // 新增:在爆炸动画开始后立即隐藏炸弹,动画结束后销毁
|
|
|
+ this.sprite.visible = false; // 先隐藏视觉元素
|
|
|
+
|
|
|
+ // 在爆炸完成回调中销毁炸弹
|
|
|
+ const originalOnComplete = onComplete;
|
|
|
+ onComplete = () => {
|
|
|
+ // 销毁炸弹容器及其内部所有元素
|
|
|
+ if (this.sprite) {
|
|
|
+ this.sprite.destroy();
|
|
|
+ }
|
|
|
+ if (this.bombEmit) {
|
|
|
+ this.bombEmit.destroy();
|
|
|
+ }
|
|
|
+ if (this.bombSmoke) {
|
|
|
+ this.bombSmoke.destroy();
|
|
|
+ }
|
|
|
+ // 执行原有的完成回调
|
|
|
+ if (typeof originalOnComplete === 'function') {
|
|
|
+ originalOnComplete();
|
|
|
+ }
|
|
|
+ };
|
|
|
}
|
|
|
getSprite() {
|
|
|
return this.sprite;
|