using UnityEngine; namespace Escape_Room_Engine.Desert.Scripts { public class EmissionToggle : MonoBehaviour { internal bool active; private bool _previousActive; private Material _material; private void Awake() { _material = GetComponent().material; } private void Start() { Changed(); } private void Update() { if (_previousActive != active) { Changed(); _previousActive = active; } } private void Changed() { if (active) { _material.EnableKeyword("_EMISSION"); } else { _material.DisableKeyword("_EMISSION"); } } public void SetActive(bool to) { this.active = to; } } }