Exemplo n.º 1
0
	public IEnumerator DownloadListOfChildsNames ()
	{
		Debug.Log ("fileName: " + fileName);

		Debug.Log ("Init download - Childs names...");
		ES2Web web = new ES2Web (myURL + "&tag=names");

		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
			childListGO [0].transform.localPosition = new Vector3 (0, 444, 0);

		} else {
			List<ArrayWrapper> childNamesList = web.LoadList<ArrayWrapper> ("names");
			//List<string> childNamesList = web.LoadList<string> ("names");
			Config.childNames = childNamesList;
			Debug.Log ("Finished downloading names...");
			StartCoroutine ("DownloadListOfChildsPhotos");
		}
	}
Exemplo n.º 2
0
	public IEnumerator DownloadTexture2D()
	{
		// Create a URL and add parameters to the end of it.
		string myURL = "http://clientes.cheny.com.br/stephanie/es2.php";
		myURL += "?webfilename=image.png&webusername=cheny&webpassword=chenyrox";
		
		// Create our ES2Web object.
		ES2Web web = new ES2Web(myURL);
		
		// 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<UITexture>().mainTexture = web.LoadImage();
		}
	}
Exemplo n.º 3
0
    public IEnumerator DownloadListOfChildsNames()
    {
        Debug.Log("fileName: " + fileName);

        Debug.Log("Init download - Childs names...");
        ES2Web web = new ES2Web(myURL + "&tag=names");

        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
            childListGO [0].transform.localPosition = new Vector3(0, 444, 0);
        }
        else
        {
            List <ArrayWrapper> childNamesList = web.LoadList <ArrayWrapper> ("names");
            //List<string> childNamesList = web.LoadList<string> ("names");
            Config.childNames = childNamesList;
            Debug.Log("Finished downloading names...");
            StartCoroutine("DownloadListOfChildsPhotos");
        }
    }
Exemplo n.º 4
0
    public IEnumerator DownloadTexture2D()
    {
        // Create a URL and add parameters to the end of it.
        string myURL = "http://clientes.cheny.com.br/stephanie/es2.php";

        myURL += "?webfilename=image.png&webusername=cheny&webpassword=chenyrox";

        // Create our ES2Web object.
        ES2Web web = new ES2Web(myURL);

        // 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 <UITexture>().mainTexture = web.LoadImage();
        }
    }
Exemplo n.º 5
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.");
    }
Exemplo n.º 6
0
    public IEnumerator DownloadDatesMemories()
    {
        loadingSystem.ShowLoadingDownload();
        Debug.Log("Initing downloading dateMemories...");
        ES2Web web = new ES2Web(myURL + "&tag=memoriesDates");

        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
        {
            loadingSystem.CloseLoading();
            Config.currentChildDatesCalendarList.Clear();
            Config.currentChildDatesCalendarList = web.LoadList <ArrayWrapper> ("memoriesDates");

            Debug.Log("Finished downloading memory text...");
        }

        ShowDatesWithMemories();
    }
Exemplo n.º 7
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.");
	}
Exemplo n.º 8
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");
    }
Exemplo n.º 9
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();
        }
    }
Exemplo n.º 10
0
    public IEnumerator DownloadMemoryThumb()
    {
        Debug.Log("Initing downloading thumb...");
        ES2Web web = new ES2Web(myURL +
                                "&tag=" +
                                memoryDay +
                                "_" +
                                memoryMonth +
                                "_" +
                                memoryYear +
                                "_thumb");

        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("Finished downloading thumbs...");
            Config.currentChildDayMemoriesThumbList.Clear();

            Config.currentChildDayMemoriesThumbList = web.LoadList <Texture2D>(
                memoryDay +
                "_" +
                memoryMonth +
                "_" +
                memoryYear +
                "_thumb");

            for (int i = 0; i < Config.currentChildDayMemoriesCount; i++)
            {
                memoryList [i].CreateMemoryPhoto(Config.currentChildDayMemoriesThumbList[i]);

                //Vector3 newPos = new Vector3 (0, 530 - (i * 780), 0);
                //memoryList[i].transform.localPosition = newPos;
            }
            web.www.Dispose();
            web = null;
            Resources.UnloadUnusedAssets();

            StartCoroutine("AdjustLayout");
        }
    }
Exemplo n.º 11
0
    public IEnumerator DownloadMemoryText()
    {
        Debug.Log("Initing downloading text...");
        ES2Web web = new ES2Web(myURL +
                                "&tag=" +
                                memoryDay +
                                "_" +
                                memoryMonth +
                                "_" +
                                memoryYear +
                                "_text");

        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
        {
            Config.currentChildDayMemoriesList = web.LoadList <ArrayWrapper> (
                memoryDay +
                "_" +
                memoryMonth +
                "_" +
                memoryYear +
                "_text");

            for (int i = 0; i < Config.currentChildDayMemoriesCount; i++)
            {
                memoryList [i].CreateMemoryText(
                    i,
                    Config.currentChildDayMemoriesList [i].array [0],
                    Config.currentChildDayMemoriesList [i].array [1],
                    Config.currentChildDayMemoriesList [i].array [2],
                    Config.currentChildDayMemoriesList [i].array [3],
                    Config.currentChildDayMemoriesList [i].array [4],
                    Config.currentChildDayMemoriesList [i].array [5]);
            }

            Debug.Log("Finished downloading memory text...");
            StartCoroutine("DownloadMemoryThumb");
        }
    }
Exemplo n.º 12
0
    public IEnumerator DownloadListOfChildsPhotos()
    {
        Debug.Log("Init download - Childs photos...");
        web2 = new ES2Web(myURL + "&tag=photos");

        canCheck = true;
        yield return(StartCoroutine(web2.Download()));

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

            //TODO
            //Make user go back to login if error
        }
        else
        {
            Debug.Log("Finished downloading photos...");
            List <Texture2D> childPhotosList = web2.LoadList <Texture2D> ("photos");
            Config.childTextures2D = childPhotosList;

            for (int i = 0; i < childPhotosList.Count; i++)
            {
                childListGO [i].GetComponentInChildren <UITexture> ().mainTexture = childPhotosList [i];
                childListGO [i].GetComponentInChildren <UILabel> ().text          = Config.childNames [i].array [1];

                NGUITools.SetActive(childListGO [i].transform.Find("ArrowButton").gameObject, true);
                NGUITools.SetActive(childListGO [i].transform.Find("Button").gameObject, false);

                if (i < 4)
                {
                    childListGO [i].transform.localPosition = new Vector3(0, 444 - (190 * i), 0);
                }
            }

            if (childPhotosList.Count < 4)
            {
                childListGO [childPhotosList.Count].transform.localPosition = new Vector3(0, 444 - (190 * childPhotosList.Count), 0);
            }

            loadingSystem.CloseLoading();
        }
    }
Exemplo n.º 13
0
        private void DownloadArrayList()
        {
            if (!isProxyValid())
            {
                return;
            }


            _tag = uniqueTag.Value;
            if (string.IsNullOrEmpty(_tag))
            {
                _tag = Fsm.GameObjectName + "/" + Fsm.Name + "/arraylist/" + reference.Value;
            }



            web = new ES2Web(urlToPHPFile + "?tag=" + _tag + "&webfilename=" + saveFile.Value + "&webpassword="******"&webusername="******"Downloading from " + urlToPHPFile.Value + "?tag=" + uniqueTag.Value + "&webfilename=" + saveFile.Value);
        }
Exemplo n.º 14
0
	public IEnumerator DownloadMemoryThumb ()
	{
		Debug.Log ("Initing downloading thumb...");
		ES2Web web = new ES2Web (myURL + 
			"&tag=" + 
			memoryDay + 
			"_" + 
			memoryMonth + 
			"_" + 
			memoryYear + 
			"_thumb");
		
		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 ("Finished downloading thumbs...");
			Config.currentChildDayMemoriesThumbList.Clear();

			Config.currentChildDayMemoriesThumbList = web.LoadList<Texture2D>(
				memoryDay + 
				"_" + 
				memoryMonth + 
				"_" + 
				memoryYear + 
				"_thumb");

			for (int i = 0; i < Config.currentChildDayMemoriesCount; i++) {
				memoryList [i].CreateMemoryPhoto (Config.currentChildDayMemoriesThumbList[i]);

				//Vector3 newPos = new Vector3 (0, 530 - (i * 780), 0);
				//memoryList[i].transform.localPosition = newPos;
			}
			web.www.Dispose();
			web = null;
			Resources.UnloadUnusedAssets();

			StartCoroutine("AdjustLayout");
		}
	}
Exemplo n.º 15
0
	public IEnumerator DownloadMemoryText ()
	{
		Debug.Log ("Initing downloading text...");
		ES2Web web = new ES2Web (myURL + 
			"&tag=" + 
			memoryDay + 
			"_" + 
			memoryMonth + 
			"_" + 
			memoryYear + 
			"_text");
		
		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 {
			Config.currentChildDayMemoriesList = web.LoadList<ArrayWrapper> (
				memoryDay + 
				"_" + 
				memoryMonth + 
				"_" + 
				memoryYear + 
				"_text");

			for (int i = 0; i < Config.currentChildDayMemoriesCount; i++) {
				memoryList [i].CreateMemoryText (
					i,
					Config.currentChildDayMemoriesList [i].array [0],
					Config.currentChildDayMemoriesList [i].array [1],
					Config.currentChildDayMemoriesList [i].array [2],
					Config.currentChildDayMemoriesList [i].array [3],
					Config.currentChildDayMemoriesList [i].array [4],
					Config.currentChildDayMemoriesList [i].array [5]);
			}

			Debug.Log ("Finished downloading memory text...");
			StartCoroutine ("DownloadMemoryThumb");
		}
	}
Exemplo n.º 16
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 ();
		}
	}
Exemplo n.º 17
0
	public IEnumerator DownloadDatesMemories ()
	{
		loadingSystem.ShowLoadingDownload ();
		Debug.Log ("Initing downloading dateMemories...");
		ES2Web web = new ES2Web (myURL + "&tag=memoriesDates");
		
		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 {
			loadingSystem.CloseLoading();
			Config.currentChildDatesCalendarList.Clear();
			Config.currentChildDatesCalendarList = web.LoadList<ArrayWrapper> ("memoriesDates");
			
			Debug.Log ("Finished downloading memory text...");
		}

		ShowDatesWithMemories ();
	}
Exemplo n.º 18
0
	public IEnumerator DownloadListOfChildsPhotos ()
	{
		Debug.Log ("Init download - Childs photos...");
		web2 = new ES2Web (myURL + "&tag=photos");

		canCheck = true;
		yield return StartCoroutine (web2.Download ());
		
		if (web2.isError) {
			Debug.LogError (web2.errorCode + ":" + web2.error);
			loadingSystem.CloseLoading();
			
			//TODO
			//Make user go back to login if error
			
		} else {
			Debug.Log ("Finished downloading photos...");
			List<Texture2D> childPhotosList = web2.LoadList<Texture2D> ("photos");
			Config.childTextures2D = childPhotosList;

			for (int i = 0; i < childPhotosList.Count; i++) {
				childListGO [i].GetComponentInChildren<UITexture> ().mainTexture = childPhotosList [i];
				childListGO [i].GetComponentInChildren<UILabel> ().text = Config.childNames [i].array [1];

				NGUITools.SetActive (childListGO [i].transform.Find ("ArrowButton").gameObject, true);
				NGUITools.SetActive (childListGO [i].transform.Find ("Button").gameObject, false);

				if (i < 4) {
					childListGO [i].transform.localPosition = new Vector3 (0, 444 - (190 * i), 0);
				}
			}

			if(childPhotosList.Count < 4){
				childListGO [childPhotosList.Count].transform.localPosition = new Vector3 (0, 444 - (190 * childPhotosList.Count), 0);
			}

			loadingSystem.CloseLoading();
		}
	}