mirror of
https://udrimavric.com/MAVRIC/Stratasys-450mc-VR.git
synced 2025-01-22 23:28:43 -05:00
26 lines
581 B
C#
26 lines
581 B
C#
|
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);
|
||
|
}
|
||
|
}
|