rabidus-test/Assets/PreviewModule.cs

46 lines
885 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]
private GameObject _previewPanel;
[SerializeField]
private RawImage _secondDisplayPreviewImage;
2023-07-28 11:48:57 +03:00
private bool _isShow = false;
private void Start()
{
TogglePanel(false);
}
public void TogglePanel(bool value)
{
_isShow = value;
if (_isShow)
{
ShowPanel();
}
else
{
HidePanel();
}
}
private void ShowPanel()
{
_previewPanel.SetActive(true);
_secondDisplayPreviewImage.gameObject.SetActive(true);
2023-07-28 11:48:57 +03:00
}
private void HidePanel()
{
_previewPanel.SetActive(false);
_secondDisplayPreviewImage.gameObject.SetActive(false);
2023-07-28 11:48:57 +03:00
}
}