17 lines
422 B
C#
17 lines
422 B
C#
|
|
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); // 直接扣光血量
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|