public void SetMenuBarProfileDetails() { if (m_user.IsLoggedIn()) { m_menuBarProfileButtonObject.GetComponentInChildren <Text>().text = m_user.m_handle; m_coroutineQueue.EnqueueAction(SetMenuBarProfileDetailsInternal()); } else { m_menuBarProfileButtonObject.GetComponentInChildren <Text>().text = "Guest"; m_imageSphereController.HideSphereAtIndex(Helper.kMenuBarProfileSphereIndex); } }
private IEnumerator LoadImageThumbnails(int startingGalleryImageIndex, int numImagesToLoad) { if (Debug.isDebugBuild) { Debug.Log(string.Format("------- VREEL: Loading {0} images beginning at index {1}. There are {2} images in the gallery!", numImagesToLoad, startingGalleryImageIndex, m_galleryImageFilePaths.Count)); } bool imageRequestStillValid = IsValidRequest(startingGalleryImageIndex); if (!imageRequestStillValid) { if (Debug.isDebugBuild) { Debug.Log("------- VREEL: LoadImages() with index = " + startingGalleryImageIndex + " has failed"); } yield break; } int currGalleryImageIndex = startingGalleryImageIndex; for (int sphereIndex = 0; sphereIndex < numImagesToLoad; sphereIndex++, currGalleryImageIndex++) { yield return(null); // Space out the work that's going on... if (currGalleryImageIndex < m_galleryImageFilePaths.Count) { string filePath = m_galleryImageFilePaths[currGalleryImageIndex]; bool identifierValid = filePath.CompareTo(m_imageSphereController.GetIdentifierAtIndex(sphereIndex)) != 0; // If file-path is the same then ignore request if (Debug.isDebugBuild) { Debug.Log("------- VREEL: Checking that filePath has changed has returned = " + identifierValid); } if (identifierValid) { bool showLoading = sphereIndex == 0; // The first one in the gallery should do some loading to let the user know things are happening LoadImageInternalPlugin(filePath, sphereIndex, currGalleryImageIndex, showLoading, Helper.kThumbnailWidth); m_imageSphereController.SetMetadataToEmptyAtIndex(sphereIndex); } } else { m_imageSphereController.HideSphereAtIndex(sphereIndex); } } }
private IEnumerator DownloadThumbnailsAndSetSpheres() { yield return(m_appDirector.VerifyInternetConnection()); int postIndex = m_currPostIndex; int numImages = m_imageSphereController.GetNumSpheres(); if (Debug.isDebugBuild) { Debug.Log(string.Format("------- VREEL: Downloading {0} images beginning at index {1}. We've found {2} posts!", numImages, postIndex, m_posts.Count)); } for (int sphereIndex = 0; sphereIndex < numImages; sphereIndex++, postIndex++) { if (postIndex < m_posts.Count) { bool showLoading = sphereIndex == 0; // The first one in the profile should do some loading to let the user know things are happening LoadImageInternalPlugin( m_posts[postIndex].thumbnailUrl, sphereIndex, postIndex, m_posts[postIndex].postId, showLoading ); m_imageSphereController.SetMetadataAtIndex( sphereIndex, m_posts[postIndex].userId, m_posts[postIndex].userHandle, m_posts[postIndex].caption, m_posts[postIndex].commentCount, m_posts[postIndex].likeCount, m_posts[postIndex].likedByMe, false ); } else { m_imageSphereController.HideSphereAtIndex(sphereIndex); } } }