rabidus-test/Assets/PreviewModule.cs

38 lines
745 B
C#
Raw Normal View History

2023-07-28 11:48:57 +03:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
2023-07-28 11:48:57 +03:00
public class PreviewModule : MonoBehaviour
{
[SerializeField]
2023-08-15 17:38:54 +03:00
private UIPanel _previewPanel;
[SerializeField]
private RawImage _secondDisplayPreviewImage;
2023-07-28 11:48:57 +03:00
public void TogglePanel(bool value)
{
2023-08-15 17:38:54 +03:00
if (value)
2023-07-28 11:48:57 +03:00
{
ShowPanel();
}
else
{
HidePanel();
}
}
private void ShowPanel()
{
2023-08-15 17:38:54 +03:00
_previewPanel.ShowPanel();
_secondDisplayPreviewImage.gameObject.SetActive(true);
2023-07-28 11:48:57 +03:00
}
private void HidePanel()
{
2023-08-15 17:38:54 +03:00
_previewPanel.HidePanel();
_secondDisplayPreviewImage.gameObject.SetActive(false);
2023-07-28 11:48:57 +03:00
}
}