From af4dd8ecbdf304b82350e84762386a3bd2491907 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 2 Jan 2023 13:31:06 +0100 Subject: [PATCH] end of lifetime fix --- assets/Scripts/Game/Unit/Enemy/Enemy.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/Scripts/Game/Unit/Enemy/Enemy.ts b/assets/Scripts/Game/Unit/Enemy/Enemy.ts index aea7b15..8eca129 100644 --- a/assets/Scripts/Game/Unit/Enemy/Enemy.ts +++ b/assets/Scripts/Game/Unit/Enemy/Enemy.ts @@ -143,6 +143,8 @@ export class Enemy extends Component { this.sprite.node.active = false; await delay(200); + if (this.sprite == null) break; + this.sprite.node.active = true; await delay(200); }