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); }
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; }); } }
void OnInfoButtonPointerDown(HotSceneCellView sceneView) { if (sceneView == baseSceneView) { return; } SetSceneView(sceneView); Vector2 localpoint; if (RectTransformUtility.ScreenPointToLocalPointInRectangle(parentRT, Input.mousePosition, null, out localpoint)) { Show(localpoint); } }
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); }
void OnHidden(ShowHideAnimator animator) { baseSceneView = null; }