增加传送门逻辑

增加无敌时间
This commit is contained in:
2026-07-05 22:50:58 +08:00
parent b7aac301ba
commit c06a8abad0
7 changed files with 322 additions and 697 deletions
+10
View File
@@ -1,5 +1,6 @@
using UnityEngine;
using GameFramework;
using IndianOceanAssets.Engine2_5D;
/// <summary>
/// 传送门/出口 Door —— 玩家碰触后触发胜利流程。
@@ -16,6 +17,15 @@ public class DoorPortal : MonoBehaviour
void OnTriggerEnter(Collider other)
{
if (!other.CompareTag("Player")) return;
// 玩家进入传送门后永久无敌,胜利流程中不再掉血
var health = other.GetComponent<HealthSystem>();
if (health != null)
{
health.MakeInvincible(); // duration<=0 即永久无敌
Debug.Log("[DoorPortal] 玩家已进入无敌状态");
}
Debug.Log("[DoorPortal] 玩家进入传送门,触发胜利!");
GameManager.Win();
}