30 lines
496 B
C#
30 lines
496 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class ShowImageByControl : MonoBehaviour
|
|
{
|
|
public GameManager.ControllerType showIfControlType;
|
|
|
|
private Image currentImage;
|
|
|
|
private void Start()
|
|
{
|
|
currentImage = GetComponent<Image>();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (showIfControlType == GameManager.Instance.controllerType)
|
|
{
|
|
if (!currentImage.enabled)
|
|
{
|
|
currentImage.enabled = true;
|
|
}
|
|
}
|
|
else if (currentImage.enabled)
|
|
{
|
|
currentImage.enabled = false;
|
|
}
|
|
}
|
|
}
|