123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using static DownLoadXRManager;
- public class ImageLoadManager : MonoBehaviour
- {
- string type = "";
- public Texture2D texture2D;
- public void loadimage(string path)
- {
- type="image";
- if(path==""||path==null)
- {
- return;
- }
- Debug.Log("开始下载图片===》"+path);
- DownLoadResources dlr = new DownLoadResources();
- dlr.path = path;
-
- DownLoadXRManager.DownLoadForTexture(dlr, msg =>
- {
- Debug.Log("开始下载图片== 完成=》"+path);
- texture2D=msg;
- this.transform.GetComponent<RawImage>().texture = msg;
- },(f)=>{
- });
- }
- public Texture2D pdftex;
- string pdfpath;
- public void loadPdf(string path)
- {
- type="pdf";
- if(path==""||path==null)
- {
- return;
- }
- Debug.Log("开始下载Pdf===》"+path);
- DownLoadResources dlr = new DownLoadResources();
- dlr.path = path;
-
- DownLoadXRManager.DownLoadForFilePath(dlr, msg =>
- {
- pdfpath=msg;
- this.transform.GetComponent<RawImage>().texture = pdftex;
-
- },(f)=>{
- });
- }
- public void showBigTexture()
- {
- if(type=="image")
- {
- TianJiWindowManager.Instance.showPoTexure2D(5,texture2D);
- }
- else
- {
- TianJiWindowManager.Instance.showPoPdf(6,pdfpath);
- }
- }
- void OnDestroy()
- {
-
- }
- }
|