using UnityEngine; namespace Ambiance { public class AmbianceHide : AmbianceSpecialBase { [SerializeField] private string id; public override void OnStart() { base.OnStart(); AmbianceController.Instance.OnAmbianceChange.AddListener(Apply); } public override void Apply() { Renderer renderer = GetComponent(); if (renderer == null || AmbianceController.Instance.CurrentAmbianceToUse == null) { return; } renderer.enabled = !AmbianceController.Instance.CurrentAmbianceToUse.hiddenElementsIds.Contains(id); } } }