Files
HauntedBloodlines/Assets/Scripts/LightFlickerTrigger.cs
2025-05-29 22:31:40 +03:00

26 lines
703 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LightFlickerTrigger : MonoBehaviour
{
[SerializeField] private LightAnimationUpdate _lightAnimationUpdate;
[SerializeField] private bool _LightIsFlickering;
[SerializeField] private bool _LightIsNotFlickering;
private void OnTriggerEnter(Collider col)
{
if (col.gameObject.tag == "Player")
{
if (_LightIsFlickering)
{
_lightAnimationUpdate.LightIsFlickering();
}
else if (_LightIsNotFlickering)
{
_lightAnimationUpdate.LightIsNotFlickering();
}
}
}
}