Open fzdravko opened 8 years ago
Please fix this. I cannot show user avatars in my game. Problem persists on both platforms (IOS & Android).
Have you tried to run the Minimal sample? I ran it and it displayed the avatar of the local player just fine.
I think there is a bug. You must first call Social.localUser.userName (and - or - Social.localUser.id) and then with coroutine above load the image. If you only try to load image, it will return null.
@fzdravko OH MY HOLY GOD! You saved me from the chasm. Thank you very much. My problem was exactly same as the sample code above, and fzdravko's workaround resolved it.
@fzdravko It worked, thanks man.
Can you someone confirm if this code is right?
if (success) { instance.pg_email = ((PlayGamesLocalUser)Social.localUser).Email; instance.pg_userName = ((PlayGamesLocalUser)Social.localUser).userName; Debug.LogWarning ("Google > avatarUrl: " + ((PlayGamesLocalUser)Social.localUser).AvatarURL); instance.pg_avatar = ((PlayGamesLocalUser)Social.localUser).image; } *pg_avatar is a Texture2D object but it always return null or a blank texture. Please Help.
I just can't make Social.localUser.Image to load profile image. I tried with StartCoroutine:
but the result is always null.