Stratasys-450mc-VR/Assets/Scripts/Managers/ShowAndHideRefenceModelManager.cs

31 lines
782 B
C#
Raw Normal View History

2023-11-01 10:51:29 -04:00
using System.Collections;
using System.Collections.Generic;
using SO.Channels;
using UnityEngine;
namespace Managers
{
public class ShowAndHideRefenceModelManager : MonoBehaviour
{
[SerializeField] private SimpleChannelSO showAndHideReferenceModelChannel;
[SerializeField] private GameObject referenceModel;
private void OnEnable()
{
showAndHideReferenceModelChannel.OnEventRaised += OnShowAndHideReferenceModel;
}
private void OnDisable()
{
showAndHideReferenceModelChannel.OnEventRaised -= OnShowAndHideReferenceModel;
}
private void OnShowAndHideReferenceModel()
{
referenceModel.SetActive(!referenceModel.activeSelf);
}
}
}