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

40 lines
1.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LightOnOffUpdate : MonoBehaviour
{
public bool lightIsOn; // You can change from the inspector if you want the light to be on or off as the default.
[SerializeField] private GameObject _lightΒulbs;
private Light[] _light;
private Renderer[] _lightRend;
private SanityActivation[] sanity;
private LightBulbEmissionUpdate lightBulbEmissionUpdate;
//float _lightRend.
//void Awake()
//{
// lightBulbEmissionUpdate
//}
public void LightOn()
{
lightIsOn = true;
foreach (Light light in _light)
{
light.enabled = true;
}
//_light.enabled = true;
foreach (Renderer renderer in _lightRend)
{
renderer.material.EnableKeyword("_EMISSION");
}
foreach (SanityActivation sanity in sanity)
{
sanity.EnableSanityTrigger();
}
print("Light is on");
}
}