26 lines
703 B
C#
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();
|
|
}
|
|
}
|
|
}
|
|
}
|