コード例 #1
0
 private void OnFriendRemoved(UserProfile profile)
 {
     if (friendViewById.TryGetValue(profile.userId, out ExploreFriendsView view))
     {
         friendPool.PoolView(view);
         friendViewById.Remove(profile.userId);
     }
 }
コード例 #2
0
    void ProcessReceivedHotScene(HotScenesController.HotSceneInfo hotSceneInfo, int priority)
    {
        Vector2Int       baseCoords   = hotSceneInfo.baseCoords;
        HotSceneCellView hotSceneView = null;

        if (cachedHotScenes.ContainsKey(baseCoords))
        {
            hotSceneView = cachedHotScenes[baseCoords];
            if (!hotSceneView)
            {
                return;
            }
        }
        else
        {
            hotSceneView = hotScenesViewPool.GetView();
            hotSceneView.Setup();
            cachedHotScenes.Add(baseCoords, hotSceneView);
        }

        hotSceneView.transform.SetSiblingIndex(priority);

        if (!hotSceneView.gameObject.activeSelf)
        {
            hotSceneView.gameObject.SetActive(true);
        }

        if (!IsHotSceneCellActive(baseCoords))
        {
            AddActiveHotSceneCell(baseCoords, hotSceneView);
        }

        hotSceneView.crowdHandler.SetCrowdInfo(hotSceneInfo);

        if (!hotSceneView.mapInfoHandler.HasMinimapSceneInfo())
        {
            mapDataController.SetMinimapData(baseCoords, hotSceneView.mapInfoHandler,
                                             (resolvedView) =>
            {
                friendsController.AddHandler(hotSceneView.friendsHandler);
            },
                                             (rejectedView) =>
            {
                hotScenesViewPool.PoolView(hotSceneView);
                cachedHotScenes[baseCoords] = null;
            });
        }
    }