rabidus-test/Assets/PreviewModule.cs

46 lines
885 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PreviewModule : MonoBehaviour
{
[SerializeField]
private GameObject _previewPanel;
[SerializeField]
private RawImage _secondDisplayPreviewImage;
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);
}
private void HidePanel()
{
_previewPanel.SetActive(false);
_secondDisplayPreviewImage.gameObject.SetActive(false);
}
}