Ejemplo n.º 1
0
//	void SetUpButtons () {
//		foreach(XmlElement node in xml.SelectNodes("Panos/Pan")){;
//			words.Add(node.InnerText);
//			GameObject b = new GameObject();
//			b = GameObject.Instantiate(genButton,new Vector3(0f,0f,0f),Quaternion.identity) as GameObject;
//			b.transform.parent = searchMenu;
//			b.GetComponent<GenButton>().SetUpButton(node.InnerText,this);
//			buttons.Add(b);
//		}
//
//	}

    void SetUpButtons()
    {
        foreach (XmlElement node in xml.SelectNodes("Panos/Category"))
        {
            ;
            CatagoryNode cat = new CatagoryNode();
            cat.name = node.GetAttribute("name");
            cats.Add(cat);

            MakeCatButton(cat);
        }
        foreach (CatagoryNode cat in cats)
        {
            List <PanoNode> tempPNode = new List <PanoNode>();
            XmlNodeList     xnList    = xml.SelectNodes("Panos/Category[@name='" + cat.name + "']/Pan");
            //Debug.Log(xnList);
            foreach (XmlNode xn in xnList)
            {
                PanoNode pan = new PanoNode();
                pan.name    = xn.SelectSingleNode("name").InnerText;
                pan.seoName = xn.SelectSingleNode("seo_name").InnerText;
                pan.folder  = xn.SelectSingleNode("folder").InnerText;
                pan.site    = xn.SelectSingleNode("site").InnerText;
//				pan.latitude = float.Parse(xn.SelectSingleNode("latitude").InnerText);
//				pan.longitude = float.Parse(xn.SelectSingleNode("longitude").InnerText);
                pan.discription = xn.SelectSingleNode("description").InnerText;
                tempPNode.Add(pan);
            }
            cat.panoNodes = tempPNode;
        }
    }
Ejemplo n.º 2
0
 public void MakeCatButton(CatagoryNode cat)
 {
     cat.catButton = GameObject.Instantiate(genButton, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject;
     cat.catButton.transform.parent = searchMenu;
     cat.catButton.AddComponent <CatButton>();
     cat.catButton.GetComponent <CatButton>().catNode = cat;
     cat.catButton.GetComponent <CatButton>().menu    = this;
     cat.catButton.GetComponent <CatButton>().DrawButton();
 }
Ejemplo n.º 3
0
 public void MakePanButton(CatagoryNode cat)
 {
     foreach (PanoNode p in cat.panoNodes)
     {
         p.panButton = GameObject.Instantiate(genButton, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject;
         p.panButton.transform.parent = searchMenu;
         p.panButton.AddComponent <PanButton>();
         p.panButton.GetComponent <PanButton>().panNode = p;
         p.panButton.GetComponent <PanButton>().menu    = this;
         p.panButton.GetComponent <PanButton>().DrawButton();
         buttons.Add(p.panButton);
     }
 }
Ejemplo n.º 4
0
 public void CatSelect(CatagoryNode cat)
 {
     KillCatButtons();
     MakePanButton(cat);
 }