using System.Collections; using System.Collections.Generic; using SO.Channels; using UnityEngine; public class UIToggler : MonoBehaviour { [SerializeField] private SimpleChannelSO showAndHideUIChannel; [SerializeField] private GameObject uiElement; private void OnEnable() { showAndHideUIChannel.OnEventRaised += OnShowAndHideUI; } private void OnDisable() { showAndHideUIChannel.OnEventRaised -= OnShowAndHideUI; } private void OnShowAndHideUI() { uiElement.SetActive(!uiElement.activeSelf); } }