예제 #1
0
    /* Downloads a texture from the server */
    private IEnumerator Download()
    {
        ES2Web web = new ES2Web(url, CreateSettings());

        // Start downloading our Texture and wait for it to finish.
        yield return(StartCoroutine(web.Download()));

        if (web.isError)
        {
            // If there's no data to load, return.
            // Note: code "05" means that no data was found.
            if (web.errorCode == "05")
            {
                yield break;
            }

            Debug.LogError(web.errorCode + ":" + web.error);
            yield break;
        }

        // Load the Texture from the ES2Web object, using the correct tag.
        SetTexture(web.Load <Texture2D>(textureTag));

        // Delete the data so our example works properly.
        yield return(StartCoroutine(Delete()));

        Debug.Log("Texture successfully downloaded and applied to blank object.");
    }
예제 #2
0
    public IEnumerator DownloadText()
    {
        // Create a URL and add parameters to the end of it.
        string myURL = "http://clientes.cheny.com.br/stephanie/es2.php";

        myURL += "?webfilename=text.txt&webusername=cheny&webpassword=chenyrox";

        // Create our ES2Web object.
        ES2Web web = new ES2Web(myURL + "&tag=texto1234");

        // Start downloading our data and wait for it to finish.
        yield return(StartCoroutine(web.Download()));

        if (web.isError)
        {
            // Enter your own code to handle errors here.
            Debug.LogError(web.errorCode + ":" + web.error);
        }
        else
        {
            // We could save our data to a local file and load from that.
            //web.SaveToFile("myFile.txt");

            // Or we could just load directly from the ES2Web object.
            //this.GetComponent<MeshFilter>().mesh = web.Load<Mesh>(tag);
            GetComponent <UILabel>().text = web.Load <string>("texto1234");
        }
    }
예제 #3
0
	/* Downloads a texture from the server */
	private IEnumerator Download()
	{
		 ES2Web web = new ES2Web(url, CreateSettings());
	      
	    // Start downloading our Texture and wait for it to finish.
	    yield return StartCoroutine(web.Download());
	      
	    if(web.isError)
		{
			// If there's no data to load, return.
			// Note: code "05" means that no data was found.
			if(web.errorCode == "05")
				yield break;
				
	        Debug.LogError(web.errorCode + ":" + web.error);
	        yield break;
		}
		
		// Load the Texture from the ES2Web object, using the correct tag.
		SetTexture( web.Load<Texture2D>(textureTag) );
		
		// Delete the data so our example works properly.
		yield return StartCoroutine (Delete());
		Debug.Log ("Texture successfully downloaded and applied to blank object.");
	}
예제 #4
0
    public IEnumerator DownloadMesh1()
    {
        // Create a URL and add parameters to the end of it.
        string myURL = "http://cgi.soic.indiana.edu/~team05/ES2.php";

        myURL += "?webfilename=" + str1 + "&webusername=tsajnani&webpassword=Capstone2017";

        // Create our ES2Web object.
        ES2Web web1 = new ES2Web(myURL + "&tag=tag");

        // Start downloading our data and wait for it to finish.
        yield return(StartCoroutine(web1.Download()));

        if (web1.isError)
        {
            // Enter your own code to handle errors here.
            Debug.LogError(web1.errorCode + ":" + web1.error);
        }
        else
        {
            // Or we could just load directly from the ES2Web object.
            Vector3 cubepos1 = web1.Load <Vector3>("tag");
            Load1(cubepos1);
        }
        Debug.Log("1");
    }
예제 #5
0
    public IEnumerator DownloadMemoryCount()
    {
        Debug.Log("Initing downloading count...");
        ES2Web web = new ES2Web(myURL +
                                "&tag=" +
                                memoryDay +
                                "_" +
                                memoryMonth +
                                "_" +
                                memoryYear +
                                "_count");

        yield return(StartCoroutine(web.Download()));

        if (web.isError)
        {
            Debug.LogError(web.errorCode + ":" + web.error);
            loadingSystem.CloseLoading();

            //TODO
            //Make user go back to login if error
        }
        else
        {
            Debug.Log("Total #: " + Config.currentChildDayMemoriesCount);

            Config.currentChildDayMemoriesCount = web.Load <int> (memoryDay + "_" + memoryMonth + "_" + memoryYear + "_count");
            Debug.Log("Finished memory from: " + memoryDay + "_" + memoryMonth + "_" + memoryYear);
            Debug.Log("Total memories: " + Config.currentChildDayMemoriesCount);

            CreateMemoriesList();
        }
    }
예제 #6
0
	public IEnumerator DownloadMemoryCount ()
	{
		Debug.Log ("Initing downloading count...");
		ES2Web web = new ES2Web (myURL + 
			"&tag=" + 
			memoryDay + 
			"_" + 
			memoryMonth + 
			"_" + 
			memoryYear + 
			"_count");
		
		yield return StartCoroutine (web.Download ());
		
		if (web.isError) {
			Debug.LogError (web.errorCode + ":" + web.error);
			loadingSystem.CloseLoading ();
			
			//TODO
			//Make user go back to login if error
			
		} else {

			Debug.Log ("Total #: " + Config.currentChildDayMemoriesCount);

			Config.currentChildDayMemoriesCount = web.Load<int> (memoryDay + "_" + memoryMonth + "_" + memoryYear + "_count");
			Debug.Log ("Finished memory from: " + memoryDay + "_" + memoryMonth + "_" + memoryYear);
			Debug.Log ("Total memories: " + Config.currentChildDayMemoriesCount);

			CreateMemoriesList ();
		}
	}
예제 #7
0
	public IEnumerator DownloadText()
	{
		// Create a URL and add parameters to the end of it.
		string myURL = "http://clientes.cheny.com.br/stephanie/es2.php";
		myURL += "?webfilename=text.txt&webusername=cheny&webpassword=chenyrox";
		
		// Create our ES2Web object.
		ES2Web web = new ES2Web(myURL + "&tag=texto1234");
		
		// Start downloading our data and wait for it to finish.
		yield return StartCoroutine(web.Download());
		
		if(web.isError)
		{
			// Enter your own code to handle errors here.
			Debug.LogError(web.errorCode + ":" + web.error);
		}
		else
		{
			// We could save our data to a local file and load from that.
			//web.SaveToFile("myFile.txt");
			
			// Or we could just load directly from the ES2Web object.
			//this.GetComponent<MeshFilter>().mesh = web.Load<Mesh>(tag);
			GetComponent<UILabel>().text = web.Load<string>("texto1234");
		}
	}