Exemplo n.º 1
0
    public void Button_Generate()
    {
        Debug.Log("Etaj1: " + dd_etaj1.GetComponent <Dropdown>().value + " - Camera1: " + dd_camera1.GetComponent <Dropdown>().value +
                  "\nEtaj2: " + dd_etaj2.GetComponent <Dropdown>().value + " - Camera2: " + dd_camera2.GetComponent <Dropdown>().value);

        Deserialize.stringXmlPath = "D:\\format_date_path.xml";

        etaj_camera1 = dd_etaj1.GetComponent <Dropdown>().value;
        etaj_camera2 = dd_etaj2.GetComponent <Dropdown>().value;
        camera1      = dd_camera1.GetComponent <Dropdown>().value;
        camera2      = dd_camera2.GetComponent <Dropdown>().value;
        Deserialize d = new Deserialize();
        //x1 y1 de la usa, x1 y1 de la cealalta usa, etaj de la prima usa, etaj de la a doua usa

        string output  = "";
        int    douaUsi = 0;

        int valueIndex = dd_camera1.GetComponent <Dropdown>().value;
        List <Dropdown.OptionData> menuOptions = dd_camera1.GetComponent <Dropdown>().options;
        string numeCamera = menuOptions[valueIndex].text;

        List <string> value2 = new List <string>();

        value2.Clear();
        value2 = Deserialize.getUsa(dd_etaj1.GetComponent <Dropdown>().value, numeCamera);
        foreach (string value3 in value2)
        {
            Debug.Log("USA1 = " + value3);
            output += value3 + " ";
            douaUsi++;
            if (douaUsi == 2)
            {
                break;
            }
        }
        douaUsi = 0;
        output += dd_etaj1.GetComponent <Dropdown>().value + " ";
        Deserialize.setUsi(dd_etaj1.GetComponent <Dropdown>().value);

        int valueIndex1 = dd_camera2.GetComponent <Dropdown>().value;
        List <Dropdown.OptionData> menuOptions1 = dd_camera2.GetComponent <Dropdown>().options;
        string numeCamera1 = menuOptions1[valueIndex1].text;

        List <string> value4 = new List <string>();

        value4.Clear();
        value4 = Deserialize.getUsa(dd_etaj2.GetComponent <Dropdown>().value, numeCamera1);
        foreach (string value5 in value4)
        {
            Debug.Log("USA2 = " + value5);
            output += value5 + " ";
            douaUsi++;
            if (douaUsi == 2)
            {
                break;
            }
        }
        douaUsi = 0;
        output += dd_etaj2.GetComponent <Dropdown>().value;
        Deserialize.setUsi(dd_etaj2.GetComponent <Dropdown>().value);
        Debug.Log("output = " + output + "xMin,xMax" + Deserialize.xMin + Deserialize.xMax + "yMin,yMax" + Deserialize.yMin + Deserialize.yMax);
        //de vazut cum se returneaza stringul din dropdown
        d.Connect("localhost", output);


        dd_2d_etaj.value = 0;
        Dropdown_IndexChanged_Vizualizare_Etaj(0);
    }