Hello, hrere is my code , i just want to know can i load 3d object in .fbx at runtime from webservice by hitting url ???
using UnityEngine;
using System.Collections;
using System.Xml;
public class parsing2 : MonoBehaviour
{
public GUIStyle Button;
public bool p;
string tex;
public string[] name;
public GameObject[] G;
public GameObject Model;
// Use this for initialization
void Start ()
{
p=false;
}
// Update is called once per frame
void Update ()
{
if(p==true)
{
parse();
}
}
void parse()
{
var xmlDoc = new XmlDocument();
xmlDoc.Load("http://youngmoneyapps.info/RoyalBaby/request.php?action=topTen");
XmlNodeList transformList = xmlDoc.GetElementsByTagName("response");
foreach (XmlNode transformInfo in transformList)
{
XmlNodeList transformcontent = transformInfo.ChildNodes;
foreach (XmlNode transformItens in transformcontent)
{
if(transformItens.Name == "suggestName")
{
// Wait for download to complete
Start1();
// renderer.material.mainTexture = www.texture;
name=new string[]{tex};
}
if(transformItens.Name == "counter")
{
Debug.Log (transformItens.InnerText);
}
}
//Do the same with all the other tags that are nested inside the <playerdata>
}
}
void OnGUI()
{
if (GUI.Button(new Rect(10, 70, 50, 30), "Click",Button))
{
p=true;
}
}
IEnumerator Start1()
{
Debug.Log("fdef");
WWW www = new WWW("http://youngmoneyapps.info/RoyalBaby/request.php?action=topTen");
yield return www;
renderer.material.mainTexture = www.texture;
}
}
Thankz