示例#1
0
    IEnumerator Start()
    {
        sliderSection = GameObject.Find("SliderSection").GetComponent <SliderGestureControl>();
        //slider = GetComponentInChildren<Slider>();
        //section = GetComponentInChildren<Toggle>();
        //section.isOn = false;
        toggleSection = GameObject.Find("ToggleSection").GetComponent <InteractiveToggle>();
        //toggleSection.HasSelection = false;
        status      = GameObject.Find("Status").GetComponent <TextMesh>();
        status.text = "LOADING ...";
        //status.active = false;

        //string url = "http://140.247.162.82:9000/point";
        WWW www = new WWW(url);

        yield return(www);

        if (!string.IsNullOrEmpty(www.error))
        {
            print(www.error);
            status.text = "ERROR: " + www.error + " ...";
            //waiting.enabled = true;
        }
        else
        {
            status.text = "DOWNLOADING CFD ...";
            //waiting.enabled = true;

            cfd = ArrayJson.getJsonArray <p0>(www.text);
            //StartCoroutine(CheckData());
            CheckData();
        }
        //CheckData();
    }
示例#2
0
 public MainWindowC()
 {
     InitializeComponent();
     this.viewModel   = new GreetingViewModel();
     this.DataContext = this.viewModel;
     this.Idtest      = new ArrayJson
     {
         id = "JE TEEEEEST",
     };
 }
示例#3
0
        public void TestGetListLigne()
        {
            UtilApi prog = new UtilApi(new FakeAppelsApi());
            Dictionary <string, List <ArrayJson> > ATeste = prog.getListLigne(500);
            ArrayJson pourTest = new ArrayJson();

            pourTest.id    = "SEM:1986";
            pourTest.name  = "GRENOBLE, CASERNE DE BONNE";
            pourTest.lon   = 5.72533;
            pourTest.lat   = 45.18506;
            pourTest.zone  = "SEM_GENCASBONNE";
            pourTest.lines = new List <string>();
            pourTest.lines.Add("SEM:16");


            Assert.AreEqual(ATeste["GRENOBLE, CASERNE DE BONNE"][0].lines[0], pourTest.lines[0]);
            Assert.AreEqual(ATeste["GRENOBLE, CASERNE DE BONNE"][0].id, pourTest.id);
            Assert.AreEqual(ATeste["GRENOBLE, CASERNE DE BONNE"][0].name, pourTest.name);
            Assert.AreEqual(ATeste["GRENOBLE, CASERNE DE BONNE"][0].lon, pourTest.lon);
            Assert.AreEqual(ATeste["GRENOBLE, CASERNE DE BONNE"][0].lat, pourTest.lat);
            Assert.AreEqual(ATeste["GRENOBLE, CASERNE DE BONNE"][0].zone, pourTest.zone);
        }
示例#4
0
    IEnumerator Start()
    {
        if (hasInternet)  // Ping.hasInternet )
        {
            // Debug.Log("MAKING HTTP CONNECTION");

            status.text = "LOADING VIA HTTP ...";
            UnityWebRequest www = UnityWebRequest.Get(url);
            yield return(www.SendWebRequest());

            /*
             * if (www.isNetworkError)
             * {
             *  Debug.Log(www.error);
             *  status.text = "ERROR NETWORK: " + www.error + " ...";
             * }
             * if (www.isHttpError)
             * {
             *  Debug.Log(www.error);
             *  status.text = "ERROR: " + www.error + " ...";
             *
             * }
             */

            // Debug.Log("Getting CFD");
            status.text = "GETTING CFD ...";

            cfd = ArrayJson.getJsonArray <p0>(www.downloadHandler.text);
        }

        else
        {
            cfd = ArrayJson.getJsonArray <p0>(Resources.Load <TextAsset>(localURL).text);
        }

        CheckData();
    }