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

35 lines
854 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ChangeLightColourTrigger : MonoBehaviour
{
[SerializeField] private ChangeLightColour[] _changeLightColour;
private bool _HasChanged;
private void OnTriggerEnter(Collider col)
{
if (col.gameObject.tag == "Player" && !_HasChanged)
{
ChangeLightColour();
_HasChanged = true;
}
}
public void ChangeLightColour()
{
foreach (ChangeLightColour changeLightColour in _changeLightColour)
{
changeLightColour.ChangeColour();
}
}
public void ChangeLightColourBasedOnIndices()
{
foreach (ChangeLightColour changeLightColour in _changeLightColour)
{
changeLightColour.ChangeColorBasedOnIndices();
}
}
}