public void LoadJsonRequest(string file_name, Vector3 Offset) { WWW www = new WWW(file_name); progress = 0; isDone = false; while (!www.isDone) { // Debug.Log("*** PDB: "+www.progress); progress = www.progress; } ReadJson readjson = new ReadJson(); MoleculeModel.FieldLineList = readjson.ReadFile(www.text, Offset); isDone = true; }
//Move this method to the related class public IEnumerator LoadJsonWWW(string file_name, Vector3 Offset) { WWW www = new WWW(file_name); progress = 0; isDone = false; while (!www.isDone) { // Debug.Log("*** PDB: "+www.progress); progress = www.progress; yield return(new WaitForEndOfFrame()); } ReadJson readjson = new ReadJson(); MoleculeModel.FieldLineList = readjson.ReadFile(www.text, Offset); isDone = true; }