/// <summary> /// Requests all created avatars that created by current user and determinates states for them /// </summary> private IEnumerator GetAllAvatarsFunc(int maxItems, AsyncRequest <GalleryAvatar[]> request) { Connection connection = (avatarProvider as CloudAvatarProvider).Connection; var avatarsRequest = connection.GetAvatarsAsync(maxItems); yield return(Await(avatarsRequest, null)); if (avatarsRequest.IsError) { yield break; } GalleryAvatar[] avatars = new GalleryAvatar[avatarsRequest.Result.Length]; for (int i = 0; i < avatars.Length; i++) { AvatarData avatarData = avatarsRequest.Result[i]; avatars[i] = new GalleryAvatarCloud() { code = avatarData.code, state = GetAvatarState(avatarData), avatarData = avatarData }; } request.Result = avatars; request.IsDone = true; }
protected override void InitAvatarPreview(AvatarPreview preview, string avatarCode, GalleryAvatarState avatarState) { preview.InitPreview(this, avatarCode, avatarState, true); GalleryAvatarCloud avatar = loadedAvatars.FirstOrDefault(a => string.Compare(a.code, avatarCode) == 0) as GalleryAvatarCloud; preview.UpdateAvatarName(avatar.avatarData.name); }