Example #1
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();
    }
Example #2
0
        public override void OnUpdate()
        {
            if (web.isError)
            {
                errorMessage.Value = web.error;
                errorCode.Value    = web.errorCode;
                Fsm.Event(isError);
                Finish();
            }
            else if (web.isDone)
            {
                Fsm.Event(isDownloaded);

                List <string> source = web.LoadList <string>(_tag);

                if (localFile.Value != "")
                {
                    web.SaveToFile(localFile.Value);
                }


                Log("Loaded from " + saveFile.Value + "?tag=" + uniqueTag);

                proxy.arrayList.Clear();

                foreach (string element in source)
                {
                    proxy.arrayList.Add(PlayMakerUtils.ParseValueFromString(element));
                }


                Finish();
            }
        }
Example #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");
		}
	}
Example #4
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");
        }
    }
Example #5
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");
        }
    }
Example #6
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");
        }
    }
Example #7
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();
        }
    }
Example #8
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");
		}
	}
Example #9
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");
		}
	}
Example #10
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 ();
	}
Example #11
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();
		}
	}