rabidus-test/Assets/Scripts/PreviewModule.cs

38 lines
745 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PreviewModule : MonoBehaviour
{
[SerializeField]
private UIPanel _previewPanel;
[SerializeField]
private RawImage _secondDisplayPreviewImage;
public void TogglePanel(bool value)
{
if (value)
{
ShowPanel();
}
else
{
HidePanel();
}
}
private void ShowPanel()
{
_previewPanel.ShowPanel();
_secondDisplayPreviewImage.gameObject.SetActive(true);
}
private void HidePanel()
{
_previewPanel.HidePanel();
_secondDisplayPreviewImage.gameObject.SetActive(false);
}
}