private void MapRenderer_OnSceneInfoUpdated(MinimapMetadata.MinimapSceneInfo sceneInfo) { if (!sceneInfo.isPOI) { return; } if (scenesOfInterest.Contains(sceneInfo)) { return; } scenesOfInterest.Add(sceneInfo); GameObject go = Object.Instantiate(scenesOfInterestIconPrefab.gameObject, overlayContainer.transform); Vector2 centerTile = Vector2.zero; foreach (var parcel in sceneInfo.parcels) { centerTile += parcel; } centerTile /= (float)sceneInfo.parcels.Count; (go.transform as RectTransform).anchoredPosition = MapUtils.GetTileToLocalPosition(centerTile.x, centerTile.y); MapSceneIcon icon = go.GetComponent <MapSceneIcon>(); icon.title.text = sceneInfo.name; scenesOfInterestMarkers.Add(sceneInfo, go); }
private void ConfigureUserIcon(GameObject iconGO, Vector3 pos, string name) { var gridPosition = Utils.WorldToGridPositionUnclamped(pos); iconGO.transform.localPosition = MapUtils.GetTileToLocalPosition(gridPosition.x, gridPosition.y); MapSceneIcon icon = iconGO.GetComponent <MapSceneIcon>(); if (icon.title != null) { icon.title.text = name; } }