IEnumerator EndLoadPDF() { yield return(new WaitUntil(() => isThreadEnd)); isThreadEnd = false; isLoading = false; Texture2D[] pages = PDFManager.GetAllPDFPages(pathSave); for (int i = 0; i < pages.Length; i++) { GameObject pdfItem = Instantiate(pdfItemObjectPrefab) as GameObject; RawImage tmpItem = pdfItem.GetComponent <RawImage>() as RawImage; tmpItem.texture = pages[i]; pdfItem.transform.parent = scrollViewContent.transform; pdfItem.transform.localScale = Vector3.one; Debug.Log("Add new object: " + i); } }