// Open the ebook, so its metadata can be accessed. private IEnumerator getBookProperties(BookPropertySet bp) { bool retrieved = false; if (BookPropertySet.haveRecord(bp.filename)) { try { bp.Load(bp.filename); retrieved = true; } catch (Exception) { Debug.Log("Bad file " + bp.filename); } } if (!retrieved) { loading = true; Thread t = new Thread(new ParameterizedThreadStart(doLoading)); t.Start(bp); while (loading) { yield return(new WaitForSeconds(0.1f)); } // save record. bp.Save(); } }