private IEnumerator _GetUserPhoto()
    {
        string    photoUrl = UserService.user.picture;
        Texture2D texture;

        if (photoUrl == null || photoUrl.Length < 1)
        {
            texture = UtilsService.GetDefaultProfilePhoto();
        }
        else
        {
            var www = new WWW(photoUrl);
            yield return(www);

            texture = www.texture;
        }

        if (texture != null)
        {
            UserService.user.profilePicture = texture;
        }

        UserService.user.profilePicture = texture;
        PlayerPrefs.SetString("MeuVivoMuseu:Email", emailField.text);
        LoadView("Home");
    }
Пример #2
0
    private IEnumerator _GetAuthorPhoto()
    {
        string    photoUrl = post.author_photo;
        Texture2D texture;

        if (photoUrl == null || photoUrl.Length < 1)
        {
            texture = UtilsService.GetDefaultProfilePhoto();
        }
        else
        {
            Debug.Log("Current author photo url is " + photoUrl);
            var www = new WWW(photoUrl);
            yield return(www);

            texture = www.texture;
        }

        if (texture == null)
        {
            texture = UtilsService.GetDefaultProfilePhoto();
        }

        profilePic.texture = texture;
        UtilsService.SizeToParent(profilePic, 0f);
    }
Пример #3
0
	private IEnumerator _UpdatePlantPhoto ()
	{
		Texture2D texture;

		if (photoUrl == null || photoUrl.Length < 1)
		{
			texture = UtilsService.GetDefaultProfilePhoto();
		}
		else
		{
			var www = new WWW(photoUrl);
			yield return www;

			texture = UtilsService.ResizeTexture(www.texture, "Average", 0.25f);
		}

		if (texture == null)
			texture = UtilsService.GetDefaultProfilePhoto();

		photo.texture = texture;
	}