示例#1
0
    // Use this for initialization
    IEnumerator Start()
    {
        print("Loading Tour Poi's");

        WWWForm form = new WWWForm();

        form.AddField("tourIdPost", tourId);

        WWW www = new WWW(tourPoisLink, form);

        yield return(www);

        string theTour = www.text;

        tourPois = theTour.Split(';');

        print("Start lat & long: " + startLat + ", " + startLong);

        for (int i = 0; i < tourPois.Length - 1; i++)
        {
            string poi = tourPois [i];
            getPois = new GetPois(poi);
            print("Poi Name: " + getPois.getName());
            print("Poi Info: " + getPois.getInformation());
            print("Poi Coordinates: " + getPois.getLatitude() + ", " + getPois.getLongitude());
        }

        print("End lat & long: " + endLat + ", " + endLong);
    }
示例#2
0
文件: LoadPois.cs 项目: lbk3/argroup
    // Use this for initialization
    IEnumerator Start()
    {
        WWW itemsData = new WWW("https://punier-boresights.000webhostapp.com/PoiData.php");

        yield return(itemsData);

        string itemsDataString = itemsData.text;

        items = itemsDataString.Split(';');

        for (int i = 0; i < items.Length - 1; i++)
        {
            getPois = new GetPois(items [i]);

            GameObject toggleCheckbox = (GameObject)Instantiate(prefabToggle);

            toggleCheckbox.transform.SetParent(ParentPanel, false);
            toggleCheckbox.transform.localScale = new Vector3(1, 1, 1);
            toggleCheckbox.SetActive(true);

            Toggle tempToggle = toggleCheckbox.GetComponent <Toggle> ();

            tempToggle.GetComponentInChildren <Text> ().text = getPois.getName();

            string tempString = getPois.getId() + "\n"
                                + getPois.getName() + "\n"
                                + getPois.getTopic() + "\n"
                                + getPois.getInformation() + "\n"
                                + getPois.getLatitude() + "\n"
                                + getPois.getLongitude() + "\n";

            string poiId = getPois.getId();

            gupp = new GetUserPoiPreferences();

            showOnMap.onClick.AddListener(() => ButtonClicked(tempToggle.isOn, tempString));
            takeMeThere.onClick.AddListener(() => getUserPois(tempToggle.isOn, poiId));
        }
    }