fix(ASTS) 修复提前收回时定时清楚仍在生效的问题

This commit is contained in:
chicrobot committed 2026-01-31 00:58:47 +08:00
1 parent 8f4616bbe7
commit 0f6987da2a
1 file changed
+10 -1
+10 -1
View File
@@ -1127,7 +1127,7 @@ export default class AttackSkillTestScene extends Phaser.Scene {
this.puppet.clearTarget();
// 一段时间后自动销毁傀儡,切换到本体控制
this.time.delayedCall(3000, () => {
this.puppetDestructionTimer = this.time.delayedCall(3000, () => {
if (this.puppet) {
// 销毁眩晕特效
if (this.stunEffect) {
@@ -1173,6 +1173,9 @@ export default class AttackSkillTestScene extends Phaser.Scene {
firstCastTime: 0,
secondCastTime: 0
};
// 清除计时器引用
this.puppetDestructionTimer = null;
}
});
@@ -1534,6 +1537,12 @@ export default class AttackSkillTestScene extends Phaser.Scene {
*/
switchToYuange(destroyPuppet = true) {
if (destroyPuppet && this.puppet) {
// 清除定时销毁任务
if (this.puppetDestructionTimer) {
this.puppetDestructionTimer.remove();
this.puppetDestructionTimer = null;
}
// 删除傀儡
this.puppet.destroy();
this.puppet = null;