/// <summary> /// ロードする /// </summary> /// <param name="pdfName"></param> void Load(string pdfName) { isPDFLoadedProperty.Value = false; gen.PDFGenerateObservable(pdfName) .Subscribe(n => { info = new PDFImageDirInfo(n); isPDFLoadedProperty.Value = true; }); }
async void Load(SynchronizationContext context) { SynchronizationContext.SetSynchronizationContext(context); var gen = new PDFGenerator(); var pdfTexturesDirectoryPath = await Task.Run(() => gen.PDFGenerate(pdfPath)); print("Finish Generate"); print($"Directory Path:{pdfTexturesDirectoryPath}"); if (!string.IsNullOrEmpty(pdfTexturesDirectoryPath)) { print("Load Textures"); var info = new PDFImageDirInfo(pdfTexturesDirectoryPath); foreach (var tex in info.imageFileURIs) { print($"Pdf To Texture :{tex}"); } } }
void Start() { gen = new PDFGenerator(); rawImage = GetComponent <RawImage>(); Load("samplePDF"); isPDFLoadedProperty.ObserveOnMainThread().Subscribe(loaded => { if (loaded) { //PDFロードが完了した時 StartCoroutine(LoadPage(0)); loadingObject.SetActive(false); } else { //初期化された時 currentPage = 0; loadingObject.SetActive(true); info = null; } }); }