Exemplo n.º 1
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.º 2
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.º 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
	/* Deletes a texture from the server */
	private IEnumerator Delete()
	{
		 ES2Web web = new ES2Web(url, CreateSettings());
	      
	    // Delete our Texture and wait for confirmation.
	    yield return StartCoroutine(web.Delete());
	      
	    if(web.isError)
	        Debug.LogError(web.errorCode + ":" + web.error);
	}
Exemplo n.º 5
0
	/* Uploads a texture to the server */
	private IEnumerator Upload(Texture2D texture)
	{
	    ES2Web web = new ES2Web(url, CreateSettings());
	      
	    // Start uploading our Texture and wait for it to finish.
	    yield return StartCoroutine(web.Upload(texture));
	      
	    if(web.isError)
	        Debug.LogError(web.errorCode + ":" + web.error);
		else
			Debug.Log ("Uploaded Successfully. Reload scene to load texture into blank object.");
	}
        public override void Reset()
        {
            gameObject = null;
            reference  = null;

            uniqueTag = new FsmString()
            {
                UseVariable = true
            };
            localFile    = "";
            saveFile     = "defaultES2File.txt";
            urlToPHPFile = "http://www.mysite.com/ES2.php";
            web          = null;
            errorMessage = "";
            errorCode    = null;
        }
Exemplo n.º 7
0
    public IEnumerator UploadPhotoThumb()
    {
        Debug.Log("Starting uploading thumb...");
        Texture2D memoryThumb = photoUITexture.mainTexture as Texture2D;

        //Config.currentChildDayMemoriesThumbList.Add (memoryThumb);

        Config.currentChildDayMemoriesThumbList [Config.currentMemoryIndex] = memoryThumb;

        ES2Web web = new ES2Web(myURL +
                                "&tag=" +
                                Config.currentMemoryDay +
                                "_" +
                                Config.currentMemoryMonth +
                                "_" +
                                Config.currentMemoryYear +
                                "_thumb");

        yield return(StartCoroutine(web.Upload(Config.currentChildDayMemoriesThumbList)));

        if (web.isError)
        {
            // Enter your own code to handle errors here.
            Debug.LogError(web.errorCode + ":" + web.error);
        }

        if (web.isDone)
        {
            Debug.Log("New thumb uploaded!");

            currentPhotoTitle.text          = titleUILabel.value;
            currentPhotoDescription.text    = descriptionUILabel.value;
            currentPhotoTexture.mainTexture = memoryThumb;

            currentPhotoTexture.MakePixelPerfect();
            currentPhotoTexture.keepAspectRatio = UIWidget.AspectRatioSource.BasedOnWidth;
            currentPhotoTexture.width           = 750;

            CloseEditMemory();
            loadingSystem.CloseLoading();
            memoriesConfig.cameFromEditPhoto = true;
            memoriesConfig.UpdateData();
        }
    }
Exemplo n.º 8
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.º 9
0
	public IEnumerator UploadTexture2D()
	{
		Debug.Log("Uploaded initiated");
		// 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.
		Texture2D texture = GetComponent<UITexture>().mainTexture as Texture2D;

		ES2Web web = new ES2Web(myURL);
		yield return StartCoroutine( web.UploadImage(texture) );
		
		if(web.isError)
		{
			// Enter your own code to handle errors here.
			Debug.LogError(web.errorCode + ":" + web.error);
		}
	}
Exemplo n.º 10
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.º 11
0
    public IEnumerator UploadText()
    {
        Debug.Log("Uploading initiated");
        // 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.
        string textUploaded = "Sei fazer upload, editado";

        ES2Web web = new ES2Web(myURL + "&tag=filho1texto1234");

        yield return(StartCoroutine(web.Upload(textUploaded)));

        if (web.isError)
        {
            // Enter your own code to handle errors here.
            Debug.LogError(web.errorCode + ":" + web.error);
        }
    }
Exemplo n.º 12
0
    public IEnumerator UploadTexture2D()
    {
        Debug.Log("Uploaded initiated");
        // 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.
        Texture2D texture = GetComponent <UITexture>().mainTexture as Texture2D;

        ES2Web web = new ES2Web(myURL);

        yield return(StartCoroutine(web.UploadImage(texture)));

        if (web.isError)
        {
            // Enter your own code to handle errors here.
            Debug.LogError(web.errorCode + ":" + web.error);
        }
    }
Exemplo n.º 13
0
    public IEnumerator UploadText()
    {
        Debug.Log("Starting uploading text...");
        //string memoryTime = System.DateTime.Now.ToString ("HH:mm");


        //TODO Edit title, description
        Config.currentChildDayMemoriesList[Config.currentMemoryIndex] = ArrayWrapper.Create(new string[] {
            titleUILabel.value,
            descriptionUILabel.value,

            Config.currentMemoryDay,
            Config.currentMemoryMonth,
            Config.currentMemoryYear,
            Config.currentMemoryTime,
        });

        ES2Web web = new ES2Web(myURL +
                                "&tag=" +
                                Config.currentMemoryDay +
                                "_" +
                                Config.currentMemoryMonth +
                                "_" +
                                Config.currentMemoryYear +
                                "_text");

        yield return(StartCoroutine(web.Upload(Config.currentChildDayMemoriesList)));

        if (web.isError)
        {
            // Enter your own code to handle errors here.
            Debug.LogError(web.errorCode + ":" + web.error);
        }

        if (web.isDone)
        {
            Debug.Log("New text uploaded!");
            StartCoroutine("UploadPhoto");
        }
    }
Exemplo n.º 14
0
    public IEnumerator UploadMesh()
    {
        Vector3 cubepos = cube.transform.position;

        // Create a URL and add parameters to the end of it.
        string myURL = "http://cgi.soic.indiana.edu/~team05/ES2.php";

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

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

        // Start uploading our data and wait for it to finish.
        yield return(StartCoroutine(web.Upload(cubepos)));

        if (web.isError)
        {
            // Enter your own code to handle errors here.
            Debug.LogError(web.errorCode + ":" + web.error);
        }

        //Debug.Log("done");
    }
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 UploadText ()
	{
		Debug.Log ("Starting uploading text...");
		string memoryTime = System.DateTime.Now.ToString ("HH:mm");
		Config.currentChildDayMemoriesList.Add (ArrayWrapper.Create (new string[]{
			titleUILabel.value,
			descriptionUILabel.value,
			memoryDay,
			memoryMonth,
			memoryYear,
			memoryTime,
		}));
		
		ES2Web web = new ES2Web (myURL + 
			"&tag=" + 
			memoryDay + 
			"_" + 
			memoryMonth + 
			"_" + 
			memoryYear + 
			"_text");
		
		yield return StartCoroutine (web.Upload (Config.currentChildDayMemoriesList));
		
		if (web.isError) {
			// Enter your own code to handle errors here.
			Debug.LogError (web.errorCode + ":" + web.error);
		}
		
		if (web.isDone) {
			Debug.Log ("New text uploaded!");
			StartCoroutine ("UploadPhoto");
		}
	}
Exemplo n.º 18
0
	public IEnumerator UploadPhoto ()
	{
		Debug.Log ("Starting uploading photos...");
		Texture2D memoryPhoto = photoUITexture.mainTexture as Texture2D;
		Config.currentChildDayMemoriesPhotoList.Add (memoryPhoto);
		
		webProgress = new ES2Web (myURL + 
			"&tag=" + 
			memoryDay + 
			"_" + 
			memoryMonth + 
			"_" + 
			memoryYear + 
			"_photo");

		canCheckProgress = true;
		yield return StartCoroutine (webProgress.Upload (Config.currentChildDayMemoriesPhotoList));
		
		if (webProgress.isError) {
			// Enter your own code to handle errors here.
			Debug.LogError (webProgress.errorCode + ":" + webProgress.error);
		}
		
		if (webProgress.isDone) {
			Debug.Log ("New photo uploaded!");
			StartCoroutine ("UploadPhotoThumb");
		}
	}
Exemplo n.º 19
0
	public IEnumerator UploadPhotoThumb ()
	{
		Debug.Log ("Starting uploading thumb...");
		//Texture2D memoryThumb = new Texture2D (photoUITexture.width, photoUITexture.height, TextureFormat.PVRTC_RGBA2, false);
		//memoryThumb = photoUITexture.mainTexture as Texture2D;
		Texture2D memoryThumb = photoUITexture.mainTexture as Texture2D;
		Config.currentChildDayMemoriesThumbList.Add (memoryThumb);
		
		ES2Web web = new ES2Web (myURL + 
			"&tag=" + 
			memoryDay + 
			"_" + 
			memoryMonth + 
			"_" + 
			memoryYear + 
			"_thumb");
		
		yield return StartCoroutine (web.Upload (Config.currentChildDayMemoriesThumbList));
		
		if (web.isError) {
			// Enter your own code to handle errors here.
			Debug.LogError (web.errorCode + ":" + web.error);
		}
		
		if (web.isDone) {
			Debug.Log ("New thumb uploaded!");
			StartCoroutine ("UploadMemoryCount");
		}
	}
Exemplo n.º 20
0
	public IEnumerator UploadChildNames ()
	{
		Debug.Log ("Starting uploading names...");
		
		List<ArrayWrapper> childNamesList = Config.childNames;

		for (int i = 0; i < childNamesList.Count; i++) {
			if(childNamesList[i].array[1] == Config.currentChildName){
				childNamesList[i].array[1] = nameUIInput.value;
				indexToEdit = i;
				break;
			}
		}
		
		ES2Web web = new ES2Web (myURL + "&tag=names");
		
		yield return StartCoroutine (web.Upload (childNamesList));
		
		if (web.isError) {
			// Enter your own code to handle errors here.
			Debug.LogError (web.errorCode + ":" + web.error);
		}
		
		if (web.isDone) {
			Debug.Log ("Edited names uploaded!");
			StartCoroutine ("UploadChildPhotos");
		}
	}
Exemplo n.º 21
0
	public IEnumerator UploadChildPhotos ()
	{
		Debug.Log ("Starting uploading photos...");
		
		List<Texture2D> childPhotoList = Config.childTextures2D;
		Texture2D texture = photoUITexture.mainTexture as Texture2D;
		//Texture2D texture = new Texture2D(photoUITexture.width, photoUITexture.height, TextureFormat.PVRTC_RGBA2, false);
		//texture = photoUITexture.mainTexture as Texture2D;

		childPhotoList.Add (texture);
		
		ES2Web web = new ES2Web (myURL + "&tag=photos");
		
		yield return StartCoroutine (web.Upload (childPhotoList));
		
		if (web.isError) {
			// Enter your own code to handle errors here.
			Debug.LogError (web.errorCode + ":" + web.error);
		}
		
		if (web.isDone) {
			Debug.Log ("New photos uploaded!");
			CloseAddNewChild ();
			selectChildConfig.UpdateData ();
		}

		photoUITexture.mainTexture = null;
	}
Exemplo n.º 22
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.º 23
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.º 24
0
	public IEnumerator UploadDate ()
	{
		Debug.Log ("Uploading date...");

		Config.currentChildDatesCalendarList.Add (ArrayWrapper.Create (new string[]{
			memoryDay,
			memoryMonth,
			memoryYear
		}));
		
		ES2Web web = new ES2Web (myURL + "&tag=memoriesDates");
		
		yield return StartCoroutine (web.Upload (Config.currentChildDatesCalendarList));
		
		if (web.isError) {
			// Enter your own code to handle errors here.
			Debug.LogError (web.errorCode + ":" + web.error);
		}
		
		if (web.isDone) {
			Debug.Log ("New memoryDate uploaded!");
			StartCoroutine ("UploadText");
		}
	}
Exemplo n.º 25
0
	public IEnumerator UploadChildNames ()
	{
		Debug.Log ("Starting uploading names...");

		List<ArrayWrapper> childNamesList = Config.childNames;

		childNamesList.Add(ArrayWrapper.Create (new string[]{
			nameUIInput.value, //Name of the file
			nameUIInput.value, //Current child name
		}));

		//childNamesList.Add (nameUIInput.value);

		ES2Web web = new ES2Web (myURL + "&tag=names");
		
		yield return StartCoroutine (web.Upload (childNamesList));

		if (web.isError) {
			// Enter your own code to handle errors here.
			Debug.LogError (web.errorCode + ":" + web.error);
		}

		if (web.isDone) {
			Debug.Log ("New names uploaded!");
			StartCoroutine ("UploadChildPhotos");
		}
	}
Exemplo n.º 26
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.º 27
0
	public IEnumerator UploadMemoryCount ()
	{
		Debug.Log ("Starting uploading count...");
		totalMemories += 1;
		ES2Web web = new ES2Web (myURL + 
			"&tag=" + 
			memoryDay + 
			"_" + 
			memoryMonth + 
			"_" + 
			memoryYear + 
			"_count");

		yield return StartCoroutine (web.Upload (totalMemories));
		
		if (web.isError) {
			Debug.LogError (web.errorCode + ":" + web.error);
		}
		
		if (web.isDone) {
			Debug.Log ("New count uploaded!");
			CloseNewMemory();
			loadingSystem.CloseLoading ();
			memoriesConfig.UpdateData();
		}

		photoUITexture.mainTexture = null;
	}
Exemplo n.º 28
0
	public IEnumerator UploadText()
	{
		Debug.Log("Uploading initiated");
		// 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.
		string textUploaded = "Sei fazer upload, editado";
		
		ES2Web web = new ES2Web(myURL + "&tag=filho1texto1234");
		yield return StartCoroutine(web.Upload(textUploaded));
		
		if(web.isError)
		{
			// Enter your own code to handle errors here.
			Debug.LogError(web.errorCode + ":" + web.error);
		}
	}
Exemplo n.º 29
0
	public IEnumerator UploadPhotoThumb ()
	{
		Debug.Log ("Starting uploading thumb...");
		Texture2D memoryThumb = photoUITexture.mainTexture as Texture2D;
		//Config.currentChildDayMemoriesThumbList.Add (memoryThumb);

		Config.currentChildDayMemoriesThumbList [Config.currentMemoryIndex] = memoryThumb;
		
		ES2Web web = new ES2Web (myURL + 
	         "&tag=" + 
	         Config.currentMemoryDay + 
	         "_" + 
	         Config.currentMemoryMonth + 
	         "_" + 
	         Config.currentMemoryYear + 
			"_thumb");
		
		yield return StartCoroutine (web.Upload (Config.currentChildDayMemoriesThumbList));
		
		if (web.isError) {
			// Enter your own code to handle errors here.
			Debug.LogError (web.errorCode + ":" + web.error);
		}
		
		if (web.isDone) {
			Debug.Log ("New thumb uploaded!");

			currentPhotoTitle.text = titleUILabel.value;
			currentPhotoDescription.text = descriptionUILabel.value;
			currentPhotoTexture.mainTexture = memoryThumb;

			currentPhotoTexture.MakePixelPerfect ();
			currentPhotoTexture.keepAspectRatio = UIWidget.AspectRatioSource.BasedOnWidth;
			currentPhotoTexture.width = 750;

			CloseEditMemory();
			loadingSystem.CloseLoading ();
			memoriesConfig.cameFromEditPhoto = true;
			memoriesConfig.UpdateData();
		}
	}
Exemplo n.º 30
0
	public IEnumerator UploadChildPhotos ()
	{
		Debug.Log ("Starting uploading photos...");
		
		List<Texture2D> childPhotoList = Config.childTextures2D;
		Texture2D texture = photoUITexture.mainTexture as Texture2D;
		childPhotoList[indexToEdit] = texture;
		
		ES2Web web = new ES2Web (myURL + "&tag=photos");
		
		yield return StartCoroutine (web.Upload (childPhotoList));
		
		if (web.isError) {
			// Enter your own code to handle errors here.
			Debug.LogError (web.errorCode + ":" + web.error);
		}
		
		if (web.isDone) {
			Debug.Log ("Edited photos uploaded!");
			currentChild.UpdateData(Config.childNames[indexToEdit].array[1], Config.childTextures2D[indexToEdit]);
			CloseEditChild ();
			selectChildConfig.UpdateData ();
		}
	}