Stratasys-450mc-VR/Assets/DisableGroupUI.cs
2023-11-01 10:51:29 -04:00

31 lines
673 B
C#

using System.Collections;
using System.Collections.Generic;
using SO.Channels;
using UnityEngine;
public class DisableGroupUI : MonoBehaviour
{
[SerializeField] private SimpleChannelSO finishedPlaceItemChannel;
[SerializeField] private List<GameObject> uiElements;
private void OnEnable()
{
finishedPlaceItemChannel.OnEventRaised += OnFinishedPlaceItem;
}
private void OnDisable()
{
finishedPlaceItemChannel.OnEventRaised -= OnFinishedPlaceItem;
}
private void OnFinishedPlaceItem()
{
foreach (var uiElement in uiElements)
{
uiElement.SetActive(false);
}
}
}