IEnumerator SetUC ()
{
GetUserInfoCB GUICB =
new
GetUserInfoCB();
AvatarJunkCB AJCB =
new
AvatarJunkCB();
UC.Username = PlayerPrefs.GetString(
"CurrentUser"
);
App42API.SetLoggedInUser(UC.Username);
userService.GetUser(
"doug"
, GUICB);
while
(!GUICB.Success && !GUICB.Failure) {
yield
return
0; }
GUICB.Reset();
userService.Authenticate(UC.Username, Encryption.Decrypt(PlayerPrefs.GetString(
"Info"
)), GUICB);
Debug.Log(Encryption.Decrypt(PlayerPrefs.GetString(
"Info"
)));
while
(!GUICB.Success && !GUICB.Failure) {
yield
return
0; }
UC.Email = GUICB.user.GetEmail();
userService.SetSessionId(GUICB.user.GetSessionId());
avatarService.GetAvatarByName(UC.Username, UC.Username, AJCB);
while
(!AJCB.Success && !AJCB.Failure) {
yield
return
0; }
UC.ProfilePicURL = AJCB.avatar.GetUrl();
yield
return
StartCoroutine(DownloadImage.GetImage(UC.ProfileMaterial, UC.ProfilePicURL));
UC.ProfilePic = Sprite.Create((Texture2D)UC.ProfileMaterial.mainTexture,
new
Rect(0, 0, UC.ProfilePicTex.width, UC.ProfilePicTex.height),
new
Vector2(0.5f, 0.5f), 100);
UC.ProfilePicTex = (Texture2D)UC.ProfileMaterial.mainTexture;
App42API.SetLoggedInUser(UC.Username);
App42Push.setApp42PushListener(
this
);
App42Push.registerForPush(
"654035403540"
);
UserC.serviceAPI = serviceAPI;
UserC.userService = userService;
UserC.avatarService = avatarService;
UserC.storageService = storageService;
UserC.pushNotificationService = pushNotificationService;
if
(AuthenticateUserScript.gameObject.activeSelf) AuthenticateUserScript.Downloaded =
true
;
if
(AuthenticateUserScript.gameObject.activeSelf) CreatingUser.Downloaded =
true
;
UserC.SetKeys();
}