修复灵灯bug
This commit is contained in:
@@ -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 即永久无敌
|
||||
|
||||
Reference in New Issue
Block a user