private void renderOwner(FriendListItem friendListItem, DataEntityHandle handle, string displayName, bool isOnline) { if (!friendListItem.IsRendered || (friendListItem.IsOnlineSet && isOnline != friendListItem.IsOnline)) { friendListItem.IsRendered = true; friendListItem.SetPreloaderActive(isActive: true); friendListItem.SetAvatarIconActive(isActive: false); if (friendAvatarRenderer.IsRenderInProgress(displayName)) { friendAvatarRenderer.CancelRender(displayName); } if (isOnline) { AvatarAnimationFrame avatarAnimationFrame = new AvatarAnimationFrame(IdlePenguinState, 0.5f); friendAvatarRenderer.RequestImage(handle, avatarAnimationFrame, "FriendsListIdle"); } else { AvatarAnimationFrame avatarAnimationFrame = new AvatarAnimationFrame(SleepingPenguinState, 0.75f); friendAvatarRenderer.RequestImage(handle, avatarAnimationFrame, "FriendsListSleeping"); } } }
private void onImageReady(DataEntityHandle handle, Texture2D icon) { ownerDisplay.SetPreloaderActive(isActive: false); ownerDisplay.SetAvatarIcon(icon); ownerDisplay.SetAvatarIconActive(isActive: true); }