private void OnFriendAdded(UserProfile profile, Color backgroundColor) { var view = friendPool.GetView(); view.SetUserProfile(profile, backgroundColor); friendViewById.Add(profile.userId, view); }
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; }); } }