LethalCompany/Lethal Company/ExportedProject/Assets/Scripts/Assembly-CSharp/CleanPlayerBodyTrigger.cs

25 lines
488 B
C#
Raw Normal View History

2023-12-22 22:51:17 +00:00
using GameNetcodeStuff;
using UnityEngine;
public class CleanPlayerBodyTrigger : MonoBehaviour
{
private bool enableCleaning = true;
public void EnableCleaningTrigger(bool enable)
{
enableCleaning = enable;
}
private void OnTriggerStay(Collider other)
{
if (enableCleaning && other.CompareTag("Player"))
{
PlayerControllerB component = other.gameObject.GetComponent<PlayerControllerB>();
if (component != null)
{
component.RemoveBloodFromBody();
}
}
}
}