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.Initialize();
            cachedHotScenes.Add(baseCoords, hotSceneView);
        }

        hotSceneView.transform.SetSiblingIndex(priority);

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

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

        hotSceneView.Setup(hotSceneInfo);
        friendsController.AddHandler(hotSceneView.friendsHandler);
    }
Exemplo n.º 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;
            });
        }
    }
Exemplo n.º 3
0
    void OnInfoButtonPointerDown(HotSceneCellView sceneView)
    {
        if (sceneView == baseSceneView)
        {
            return;
        }


        SetSceneView(sceneView);

        Vector2 localpoint;

        if (RectTransformUtility.ScreenPointToLocalPointInRectangle(parentRT, Input.mousePosition, null, out localpoint))
        {
            Show(localpoint);
        }
    }
Exemplo n.º 4
0
    void SetSceneView(HotSceneCellView sceneView)
    {
        if (baseSceneView)
        {
            baseSceneView.OnThumbnailSet -= SetThumbnail;
        }

        baseSceneView = sceneView;

        SetMapInfoData(sceneView.mapInfoHandler);

        thumbnail.texture = sceneView.thumbnailHandler.texture;
        bool hasThumbnail = thumbnail.texture != null;

        loadingSpinner.SetActive(!hasThumbnail);
        if (!hasThumbnail)
        {
            sceneView.OnThumbnailSet += SetThumbnail;
        }
    }
 void AddActiveHotSceneCell(Vector2Int coords, HotSceneCellView view)
 {
     activeHotSceneViews.Add(coords, view);
 }
        int GetFriendsCount(HotSceneCellView cell)
        {
            var friendsView = cell.transform.GetComponentsInChildren <ExploreFriendsView>(includeInactive: false);

            return(friendsView.Length);
        }
Exemplo n.º 7
0
 void OnHidden(ShowHideAnimator animator)
 {
     baseSceneView = null;
 }