ImageViewer.cs
625 Bytes
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
using System.Collections;
/**
* 功能描述: 图片放大组件
* @author wangQc
* @date 2025/6/4 09:17
*/
public class ImageViewer : MonoBehaviour
{
public static ImageViewer Instance;
public GameObject panel;
public Image fullImage;
void Awake()
{
Instance = this;
panel.SetActive(false);
}
public void ShowImage(string url)
{
panel.SetActive(true);
StartCoroutine(ImageLoader.LoadImage(url, fullImage));
}
public void Hide()
{
panel.SetActive(false);
}
}