19 lines
515 B
C#
19 lines
515 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ChangeSanityMaxValueTrigger : MonoBehaviour
|
|
{
|
|
[SerializeField] private float NewSanityMaxValue;
|
|
private bool _sanityMaxValueChanged;
|
|
|
|
private void OnTriggerEnter(Collider col)
|
|
{
|
|
if(col.gameObject.tag == "Player" && !_sanityMaxValueChanged)
|
|
{
|
|
Sanity.GetInstance().sanityChangeMaxValueAtRuntime(NewSanityMaxValue);
|
|
_sanityMaxValueChanged = true;
|
|
}
|
|
}
|
|
}
|