コード例 #1
0
    private void onImageReady(DataEntityHandle handle, Texture2D icon)
    {
        int poolIndexFromHandle = getPoolIndexFromHandle(handle);

        if (poolIndexFromHandle >= 0 && pooledScrollRect.IsIndexCellVisible(poolIndexFromHandle))
        {
            AbstractPlayerListItem component = pooledScrollRect.GetCellAtIndex(poolIndexFromHandle).GetComponent <AbstractPlayerListItem>();
            component.SetPreloaderActive(isActive: false);
            component.SetAvatarIcon(icon);
            component.SetAvatarIconActive(isActive: true);
        }
    }
コード例 #2
0
 protected void renderPlayer(AbstractPlayerListItem playerListItem, DataEntityHandle handle, string displayName, bool isOnline)
 {
     if (!playerListItem.IsRendered)
     {
         playerListItem.IsRendered = true;
         playerListItem.SetPreloaderActive(isActive: true);
         playerListItem.SetAvatarIconActive(isActive: false);
         if (playerAvatarRenderer.IsRenderInProgress(displayName))
         {
             playerAvatarRenderer.CancelRender(displayName);
         }
         if (isOnline)
         {
             AvatarAnimationFrame avatarAnimationFrame = new AvatarAnimationFrame(IdlePenguinState, 0.5f);
             playerAvatarRenderer.RequestImage(handle, avatarAnimationFrame, "FriendsListIdle");
         }
         else
         {
             AvatarAnimationFrame avatarAnimationFrame = new AvatarAnimationFrame(SleepingPenguinState, 0.75f);
             playerAvatarRenderer.RequestImage(handle, avatarAnimationFrame, "FriendsListSleeping");
         }
     }
 }