修复灵灯bug

This commit is contained in:
2026-07-05 23:05:36 +08:00
parent c06a8abad0
commit 4580a10668
5 changed files with 10 additions and 59 deletions
+2 -1
View File
@@ -19,7 +19,8 @@ public class DoorPortal : MonoBehaviour
if (!other.CompareTag("Player")) return;
// 玩家进入传送门后永久无敌,胜利流程中不再掉血
var health = other.GetComponent<HealthSystem>();
// 用 GetComponentInParent 因为碰撞体可能在子物体上
var health = other.GetComponentInParent<HealthSystem>();
if (health != null)
{
health.MakeInvincible(); // duration<=0 即永久无敌