feat(VoidKillZone): 实现玩家直接死亡空气墙

This commit is contained in:
2025-10-24 17:01:46 +08:00
parent 26fc498df1
commit 3d2f6a619d
5 changed files with 371 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
using UnityEngine;
using Script.Gameplay.Player;
namespace Script.Gameplay.Facility
{
public class VoidKillZone : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
var player = other.GetComponent<PlayerController>();
if (player != null)
{
player.TakeDamage(player.CurrentHealth); // 直接扣光血量
}
}
}
}