Files
2025TapTapGameJam/Assets/Script/Gameplay/Facility/VoidKillZone.cs

17 lines
422 B
C#
Raw Normal View History

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); // 直接扣光血量
}
}
}
}