I have the 3D model of url in the JSON keyvalue then i used Boomlagoon to parsing the values from the url but when i use JSONObject it getting first data of the keyvalue only. How can i get all the values and make array of gameobject
JSON:
StartCoroutine (JsonLoad3D("http://server.com/Unity/3DTest.txt","http://server.com/Unity/3DTest.txt"));
IEnumerator JsonLoad3D ( string jsonURL, string targetID){
WWW www = new WWW (jsonURL);
yield return www;
jsonText = www.text;
JSONObject json = JSONObject.Parse(jsonText);
url=json.GetString("link");
// if(type.Equals("3d")){
Debug.Log("3D Url load inside if is "+ url);
//Check if model is available in the scene
modal = GameObject.Find (targetID);
if (!modal) { //fetch model from the URL
Debug.Log("3D !modal is "+ url);
loadingText = (GUIText)GameObject.Find ("LoadingText").GetComponent(typeof(GUIText));
loadingText.enabled = true;
var objData = ObjReader.use.ConvertFileAsync (url, true, standardMaterial);
Debug.Log("objData is "+ objData);
while (!objData.isDone) {
loadingText.text = "Loading... " + (objData.progress*100).ToString("f0") + "%";
yield return null;
}
loadingText.enabled = false;
string modelName = objData.gameObjects[0].name;
Debug.Log("modelName is "+ modelName);
modal = GameObject.Find (modelName); // find the model reference
modal.name = targetID; // change the model name to targetID !!!
}
modalClone = Instantiate( modal ) as GameObject; //clone the model
modalClone.transform.localScale += new Vector3(250,250,250);
modalClone.transform.parent = imageTarget.transform;
}