< Summary

Class:DCL.MapRenderer
Assembly:MapRenderer
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/MapRenderer/MapRenderer.cs
Covered lines:123
Uncovered lines:109
Coverable lines:232
Total lines:515
Line coverage:53% (123 of 232)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
MapRenderer()0%110100%
Awake()0%110100%
Update()0%3.793055.56%
OnDestroy()0%110100%
Initialize()0%220100%
MoveHomePointIcon(...)0%110100%
InitializeHomePointIcon()0%110100%
EnsurePools()0%3.043083.33%
SetParcelHighlightActive(...)0%2100%
GetParcelHighlightTransform()0%110100%
SetOtherPlayersIconActive(...)0%6200%
SetPlayerIconActive(...)0%2100%
SetHighlighSize(...)0%2100%
SetHighlightStyle(...)0%2100%
Cleanup()0%550100%
CleanLandsHighlights()0%2.152066.67%
ClearLandHighlightsInfo()0%110100%
SelectLand(...)0%12300%
HighlightLands(...)0%42600%
CreateHighlightParcel(...)0%2100%
UpdateCursorMapCoords()0%6200%
IsCursorOverMapChunk()0%6200%
UpdateParcelHighlight()0%90900%
UpdateParcelHold()0%12300%
OnKernelConfigChanged(...)0%2100%
CoordinatesAreInsideTheWorld(...)0%12300%
MapRenderer_OnSceneInfoUpdated(...)0%10.0410092.86%
SetPointOfInterestActive(...)0%6200%
IsEmptyParcel(...)0%220100%
OnOtherPlayersAdded(...)0%2100%
OnOtherPlayerRemoved(...)0%6200%
ConfigureUserIcon(...)0%2100%
OnCharacterRotate(...)0%2100%
OnCharacterSetPosition(...)0%6200%
UpdateRendering(...)0%110100%
UpdateBackgroundLayer(...)0%110100%
UpdateSelectionLayer()0%110100%
UpdateOverlayLayer()0%110100%
ClickMousePositionParcel()0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/MapRenderer/MapRenderer.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using DCL.Helpers;
 4using KernelConfigurationTypes;
 5using TMPro;
 6using UnityEngine;
 7using UnityEngine.EventSystems;
 8using UnityEngine.UI;
 9using Object = UnityEngine.Object;
 10
 11namespace DCL
 12{
 13    public class MapRenderer : MonoBehaviour
 14    {
 15        const int LEFT_BORDER_PARCELS = 25;
 16        const int RIGHT_BORDER_PARCELS = 31;
 17        const int TOP_BORDER_PARCELS = 31;
 18        const int BOTTOM_BORDER_PARCELS = 25;
 19        const int WORLDMAP_WIDTH_IN_PARCELS = 300;
 20        const string MINIMAP_USER_ICONS_POOL_NAME = "MinimapUserIconsPool";
 21        const int MINIMAP_USER_ICONS_MAX_PREWARM = 30;
 22        private const int MAX_CURSOR_PARCEL_DISTANCE = 40;
 23        private const int MAX_SCENE_CHARACTER_TITLE = 29;
 24        private const string EMPTY_PARCEL_NAME = "Empty parcel";
 25
 26        public static System.Action<int, int> OnParcelClicked;
 27        public static System.Action OnCursorFarFromParcel;
 28
 1529        [SerializeField] private float parcelHightlightScale = 1.25f;
 30        [SerializeField] private Button ParcelHighlightButton;
 31        [SerializeField] private MapParcelHighlight highlight;
 32        [SerializeField] private Image parcelHighlightImage;
 33        [SerializeField] private Image parcelHighlighImagePrefab;
 34        [SerializeField] private Image parcelHighlighWithContentImagePrefab;
 35        [SerializeField] private Image selectParcelHighlighImagePrefab;
 36
 37        [HideInInspector] public Vector2Int cursorMapCoords;
 1538        [HideInInspector] public bool showCursorCoords = true;
 39        public MapAtlas atlas;
 40        public TextMeshProUGUI highlightedParcelText;
 41        public Transform overlayContainer;
 42        public Transform overlayContainerPlayers;
 43        public Transform globalUserMarkerContainer;
 44        public RectTransform playerPositionIcon;
 45
 1546        public float scaleFactor = 1f;
 47
 48        // Used as a reference of the coordinates origin in-map and as a parcel width/height reference
 49        public RectTransform centeredReferenceParcel;
 50
 51        public MapSceneIcon scenesOfInterestIconPrefab;
 52        public GameObject userIconPrefab;
 53        public GameObject homePointIconPrefab;
 54        public UserMarkerObject globalUserMarkerPrefab;
 1555        private Dictionary<Vector2Int, Image> highlightedLands = new Dictionary<Vector2Int, Image>();
 1556        private BaseVariable<Vector2Int> homePointCoordinates = DataStore.i.HUDs.homePoint;
 57        private RectTransform homePointIcon;
 58
 59        private bool isInitialized = false;
 60
 61        private Vector2Int lastClickedCursorMapCoords;
 1562        private Vector3 lastPlayerPosition = new Vector3(float.NegativeInfinity, 0, float.NegativeInfinity);
 63        private Vector2Int lastSelectedLand;
 64        private int NAVMAP_CHUNK_LAYER;
 1565        private bool otherPlayersIconsEnabled = true;
 1566        private List<Vector2Int> ownedEmptyLands = new List<Vector2Int>();
 1567        private List<Vector2Int> ownedLandsWithContent = new List<Vector2Int>();
 68
 69        private bool parcelHighlightEnabledValue = false;
 1570        private BaseVariable<Vector3> playerWorldPosition = DataStore.i.player.playerWorldPosition;
 71
 1572        private HashSet<MinimapMetadata.MinimapSceneInfo> scenesOfInterest = new HashSet<MinimapMetadata.MinimapSceneInf
 1573        private Dictionary<MinimapMetadata.MinimapSceneInfo, GameObject> scenesOfInterestMarkers = new Dictionary<Minima
 1574        private PointerEventData uiRaycastPointerEventData = new PointerEventData(EventSystem.current);
 1575        private List<RaycastResult> uiRaycastResults = new List<RaycastResult>();
 1576        private Dictionary<string, PoolableObject> usersInfoMarkers = new Dictionary<string, PoolableObject>();
 77        private Pool usersInfoPool;
 78
 1579        List<WorldRange> validWorldRanges = new List<WorldRange>
 80        {
 81            new WorldRange(-150, -150, 150, 150) // default range
 82        };
 83
 52084        public static MapRenderer i { get; private set; }
 85
 3086        private Vector3Variable playerRotation => CommonScriptableObjects.cameraForward;
 387        public Vector3 playerGridPosition => Utils.WorldToGridPositionUnclamped(playerWorldPosition.Get());
 88
 4389        public MapGlobalUsersPositionMarkerController usersPositionMarkerController { private set; get; }
 90
 91        public bool parcelHighlightEnabled
 92        {
 93            set
 94            {
 095                parcelHighlightEnabledValue = value;
 096                parcelHighlightImage.gameObject.SetActive(parcelHighlightEnabledValue);
 097                MapVisibilityChanged?.Invoke(value);
 098            }
 1199            get { return parcelHighlightEnabledValue; }
 100        }
 101
 60102        private BaseDictionary<string, Player> otherPlayers => DataStore.i.player.otherPlayers;
 103
 104        private void Awake()
 105        {
 13106            i = this;
 13107            Initialize();
 13108        }
 109
 110        void Update()
 111        {
 11112            if ((playerWorldPosition.Get() - lastPlayerPosition).sqrMagnitude >= 0.1f * 0.1f)
 113            {
 3114                lastPlayerPosition = playerWorldPosition.Get();
 3115                UpdateRendering(Utils.WorldToGridPositionUnclamped(lastPlayerPosition));
 116            }
 117
 11118            if (!parcelHighlightEnabled)
 11119                return;
 120
 0121            UpdateCursorMapCoords();
 122
 0123            UpdateParcelHighlight();
 124
 0125            UpdateParcelHold();
 0126        }
 127
 26128        public void OnDestroy() { Cleanup(); }
 129
 130        [HideInInspector]
 131        public event System.Action<float, float> OnMovedParcelCursor;
 132        public event Action<bool> MapVisibilityChanged;
 133
 134        public void Initialize()
 135        {
 15136            if (isInitialized)
 2137                return;
 138
 13139            isInitialized = true;
 140
 13141            InitializeHomePointIcon();
 13142            EnsurePools();
 13143            atlas.InitializeChunks();
 13144            NAVMAP_CHUNK_LAYER = LayerMask.NameToLayer("NavmapChunk");
 145
 13146            MinimapMetadata.GetMetadata().OnSceneInfoUpdated += MapRenderer_OnSceneInfoUpdated;
 13147            otherPlayers.OnAdded += OnOtherPlayersAdded;
 13148            otherPlayers.OnRemoved += OnOtherPlayerRemoved;
 13149            homePointCoordinates.OnChange += MoveHomePointIcon;
 13150            MoveHomePointIcon(homePointCoordinates.Get(), new Vector2Int());
 151
 13152            ParcelHighlightButton.onClick.AddListener(ClickMousePositionParcel);
 153
 13154            playerRotation.OnChange += OnCharacterRotate;
 155
 13156            highlight.SetScale(parcelHightlightScale);
 157
 13158            usersPositionMarkerController = new MapGlobalUsersPositionMarkerController(globalUserMarkerPrefab,
 159                globalUserMarkerContainer,
 160                MapUtils.CoordsToPosition);
 161
 13162            usersPositionMarkerController.SetUpdateMode(MapGlobalUsersPositionMarkerController.UpdateMode.BACKGROUND);
 163
 13164            KernelConfig.i.OnChange += OnKernelConfigChanged;
 13165        }
 166
 26167        private void MoveHomePointIcon(Vector2Int current, Vector2Int previous) { homePointIcon.anchoredPosition = MapUt
 168
 169        private void InitializeHomePointIcon()
 170        {
 13171            homePointIcon = GameObject.Instantiate(homePointIconPrefab).GetComponent<RectTransform>();
 13172            homePointIcon.gameObject.transform.SetParent(overlayContainer.transform, false);
 13173            homePointIcon.anchoredPosition = new Vector2(0, 0);
 13174            homePointIcon.transform.localPosition = new Vector3(homePointIcon.transform.localPosition.x, homePointIcon.t
 13175            homePointIcon.localScale = new Vector3(2, 2, 2);
 13176            homePointIcon.transform.SetAsFirstSibling();
 13177        }
 178
 179        private void EnsurePools()
 180        {
 13181            usersInfoPool = PoolManager.i.GetPool(MINIMAP_USER_ICONS_POOL_NAME);
 182
 13183            if (usersInfoPool == null)
 184            {
 13185                usersInfoPool = PoolManager.i.AddPool(
 186                    MINIMAP_USER_ICONS_POOL_NAME,
 187                    Instantiate(userIconPrefab.gameObject, overlayContainerPlayers.transform),
 188                    maxPrewarmCount: MINIMAP_USER_ICONS_MAX_PREWARM,
 189                    isPersistent: true);
 190
 13191                if (!Configuration.EnvironmentSettings.RUNNING_TESTS)
 0192                    usersInfoPool.ForcePrewarm();
 193            }
 13194        }
 195
 0196        public void SetParcelHighlightActive(bool isAtive) => parcelHighlightImage.enabled = isAtive;
 197
 2198        public Vector3 GetParcelHighlightTransform() => parcelHighlightImage.transform.position;
 199
 200        public void SetOtherPlayersIconActive(bool isActive)
 201        {
 0202            otherPlayersIconsEnabled = isActive;
 203
 0204            foreach (PoolableObject poolableObject in usersInfoMarkers.Values)
 205            {
 0206                poolableObject.gameObject.SetActive(isActive);
 207            }
 0208        }
 209
 0210        public void SetPlayerIconActive(bool isActive) => playerPositionIcon.gameObject.SetActive(isActive);
 211
 0212        public void SetHighlighSize(Vector2Int size) { highlight.ChangeHighlighSize(size); }
 213
 0214        public void SetHighlightStyle(MapParcelHighlight.HighlighStyle style) { highlight.SetStyle(style); }
 215
 216        public void Cleanup()
 217        {
 17218            if (atlas != null)
 15219                atlas.Cleanup();
 220
 38221            foreach (var kvp in scenesOfInterestMarkers)
 222            {
 2223                if (kvp.Value != null)
 2224                    Destroy(kvp.Value);
 225            }
 226
 17227            CleanLandsHighlights();
 17228            ClearLandHighlightsInfo();
 229
 17230            scenesOfInterestMarkers.Clear();
 231
 17232            playerRotation.OnChange -= OnCharacterRotate;
 17233            MinimapMetadata.GetMetadata().OnSceneInfoUpdated -= MapRenderer_OnSceneInfoUpdated;
 17234            otherPlayers.OnAdded -= OnOtherPlayersAdded;
 17235            otherPlayers.OnRemoved -= OnOtherPlayerRemoved;
 17236            homePointCoordinates.OnChange -= MoveHomePointIcon;
 237
 17238            ParcelHighlightButton.onClick.RemoveListener(ClickMousePositionParcel);
 239
 17240            usersPositionMarkerController?.Dispose();
 241
 17242            KernelConfig.i.OnChange -= OnKernelConfigChanged;
 243
 17244            isInitialized = false;
 17245        }
 246
 247        public void CleanLandsHighlights()
 248        {
 34249            foreach (KeyValuePair<Vector2Int, Image> kvp in highlightedLands)
 250            {
 0251                Destroy(kvp.Value.gameObject);
 252            }
 253
 17254            highlightedLands.Clear (); //To Clear out the dictionary
 17255        }
 256
 257        public void ClearLandHighlightsInfo()
 258        {
 17259            ownedLandsWithContent.Clear (); //To Clear out the content lands
 17260            ownedEmptyLands.Clear (); //To Clear out the empty content
 17261        }
 262
 263        public void SelectLand(Vector2Int coordsToSelect, Vector2Int size )
 264        {
 0265            if (highlightedLands.ContainsKey(lastSelectedLand))
 266            {
 0267                Destroy(highlightedLands[lastSelectedLand].gameObject);
 0268                highlightedLands.Remove(lastSelectedLand);
 269            }
 270
 0271            HighlightLands(ownedEmptyLands, ownedLandsWithContent);
 272
 0273            if (highlightedLands.ContainsKey(coordsToSelect))
 274            {
 0275                Destroy(highlightedLands[coordsToSelect].gameObject);
 0276                highlightedLands.Remove(coordsToSelect);
 277            }
 278
 0279            CreateHighlightParcel(selectParcelHighlighImagePrefab, coordsToSelect, size);
 0280            lastSelectedLand = coordsToSelect;
 0281        }
 282
 283        public void HighlightLands(List<Vector2Int> landsToHighlight, List<Vector2Int> landsToHighlightWithContent)
 284        {
 0285            CleanLandsHighlights();
 286
 0287            foreach (Vector2Int coords in landsToHighlight)
 288            {
 0289                if (highlightedLands.ContainsKey(coords))
 290                    continue;
 291
 0292                CreateHighlightParcel(parcelHighlighImagePrefab, coords, Vector2Int.one);
 293            }
 294
 0295            foreach (Vector2Int coords in landsToHighlightWithContent)
 296            {
 0297                if (highlightedLands.ContainsKey(coords))
 298                    continue;
 299
 0300                if (!ownedLandsWithContent.Contains(coords))
 0301                    ownedLandsWithContent.Add(coords);
 0302                CreateHighlightParcel(parcelHighlighWithContentImagePrefab, coords, Vector2Int.one);
 303            }
 304
 0305            ownedEmptyLands = landsToHighlight;
 0306            ownedLandsWithContent = landsToHighlightWithContent;
 0307        }
 308
 309        private void CreateHighlightParcel(Image prefab, Vector2Int coords, Vector2Int size)
 310        {
 0311            var highlightItem = Instantiate(prefab, overlayContainer, true).GetComponent<Image>();
 0312            highlightItem.rectTransform.localScale = new Vector3(parcelHightlightScale * size.x, parcelHightlightScale *
 0313            highlightItem.rectTransform.SetAsLastSibling();
 0314            highlightItem.rectTransform.anchoredPosition = MapUtils.CoordsToPosition(coords);
 0315            highlightedLands.Add(coords, highlightItem);
 0316        }
 317
 318        void UpdateCursorMapCoords()
 319        {
 0320            if (!IsCursorOverMapChunk())
 0321                return;
 322
 323            const int OFFSET = -60; //Map is a bit off centered, we need to adjust it a little.
 0324            RectTransformUtility.ScreenPointToLocalPointInRectangle(atlas.chunksParent, Input.mousePosition, DataStore.i
 0325            mapPoint -= Vector2.one * OFFSET;
 0326            mapPoint -= (atlas.chunksParent.sizeDelta / 2f);
 0327            cursorMapCoords = Vector2Int.RoundToInt(mapPoint / MapUtils.PARCEL_SIZE);
 0328        }
 329
 330        bool IsCursorOverMapChunk()
 331        {
 0332            uiRaycastPointerEventData.position = Input.mousePosition;
 0333            EventSystem.current.RaycastAll(uiRaycastPointerEventData, uiRaycastResults);
 334
 0335            return uiRaycastResults.Count > 0 && uiRaycastResults[0].gameObject.layer == NAVMAP_CHUNK_LAYER;
 336        }
 337
 338        void UpdateParcelHighlight()
 339        {
 0340            if (!CoordinatesAreInsideTheWorld((int)cursorMapCoords.x, (int)cursorMapCoords.y))
 341            {
 0342                if (parcelHighlightImage.gameObject.activeSelf)
 0343                    parcelHighlightImage.gameObject.SetActive(false);
 344
 0345                return;
 346            }
 347
 0348            if (!parcelHighlightImage.gameObject.activeSelf)
 0349                parcelHighlightImage.gameObject.SetActive(true);
 350
 0351            string previousText = highlightedParcelText.text;
 0352            parcelHighlightImage.rectTransform.SetAsLastSibling();
 0353            parcelHighlightImage.rectTransform.anchoredPosition = MapUtils.CoordsToPosition(cursorMapCoords);
 0354            highlightedParcelText.text = showCursorCoords ? $"{cursorMapCoords.x}, {cursorMapCoords.y}" : string.Empty;
 355
 0356            if (highlightedParcelText.text != previousText && !Input.GetMouseButton(0))
 357            {
 0358                OnMovedParcelCursor?.Invoke(cursorMapCoords.x, cursorMapCoords.y);
 359            }
 360
 361            // ----------------------------------------------------
 362            // TODO: Use sceneInfo to highlight whole scene parcels and populate scenes hover info on navmap once we can
 363            // var sceneInfo = mapMetadata.GetSceneInfo(cursorMapCoords.x, cursorMapCoords.y);
 0364        }
 365
 366        void UpdateParcelHold()
 367        {
 0368            if (Vector2.Distance(lastClickedCursorMapCoords, cursorMapCoords) > MAX_CURSOR_PARCEL_DISTANCE / (scaleFacto
 369            {
 0370                OnCursorFarFromParcel?.Invoke();
 371            }
 0372        }
 373
 0374        private void OnKernelConfigChanged(KernelConfigModel current, KernelConfigModel previous) { validWorldRanges = c
 375
 376        bool CoordinatesAreInsideTheWorld(int xCoord, int yCoord)
 377        {
 0378            foreach (WorldRange worldRange in validWorldRanges)
 379            {
 0380                if (worldRange.Contains(xCoord, yCoord))
 381                {
 0382                    return true;
 383                }
 384            }
 0385            return false;
 0386        }
 387
 388        private void MapRenderer_OnSceneInfoUpdated(MinimapMetadata.MinimapSceneInfo sceneInfo)
 389        {
 5390            if (!sceneInfo.isPOI)
 3391                return;
 392
 2393            if (scenesOfInterest.Contains(sceneInfo))
 0394                return;
 395
 2396            if (IsEmptyParcel(sceneInfo))
 0397                return;
 398
 2399            scenesOfInterest.Add(sceneInfo);
 400
 2401            GameObject go = Object.Instantiate(scenesOfInterestIconPrefab.gameObject, overlayContainer.transform);
 402
 2403            Vector2 centerTile = Vector2.zero;
 404
 20405            foreach (var parcel in sceneInfo.parcels)
 406            {
 8407                centerTile += parcel;
 408            }
 409
 2410            centerTile /= (float)sceneInfo.parcels.Count;
 2411            float distance = float.PositiveInfinity;
 2412            Vector2 centerParcel = Vector2.zero;
 20413            foreach (var parcel in sceneInfo.parcels)
 414            {
 8415                if (Vector2.Distance(centerTile, parcel) < distance)
 416                {
 5417                    distance = Vector2.Distance(centerParcel, parcel);
 5418                    centerParcel = parcel;
 419                }
 420
 421            }
 422
 2423            (go.transform as RectTransform).anchoredPosition = MapUtils.CoordsToPosition(centerParcel);
 424
 2425            MapSceneIcon icon = go.GetComponent<MapSceneIcon>();
 426
 2427            if (icon.title != null)
 2428                icon.title.text = sceneInfo.name.Length > MAX_SCENE_CHARACTER_TITLE ? sceneInfo.name.Substring(0, MAX_SC
 429
 2430            scenesOfInterestMarkers.Add(sceneInfo, go);
 2431        }
 432
 433        public void SetPointOfInterestActive(bool areActive)
 434        {
 0435            foreach (GameObject pointOfInterestGameObject in scenesOfInterestMarkers.Values)
 436            {
 0437                pointOfInterestGameObject.SetActive(areActive);
 438            }
 0439        }
 440
 2441        private bool IsEmptyParcel(MinimapMetadata.MinimapSceneInfo sceneInfo) { return (sceneInfo.name != null && scene
 442
 443        private void OnOtherPlayersAdded(string userId, Player player)
 444        {
 0445            var poolable = usersInfoPool.Get();
 0446            var marker = poolable.gameObject.GetComponent<MapUserIcon>();
 0447            marker.gameObject.name = $"UserIcon-{player.name}";
 0448            marker.gameObject.transform.SetParent(overlayContainerPlayers.transform, true);
 0449            marker.Populate(player);
 0450            marker.gameObject.SetActive(otherPlayersIconsEnabled);
 0451            marker.transform.localScale = Vector3.one;
 0452            usersInfoMarkers.Add(userId, poolable);
 0453        }
 454
 455        private void OnOtherPlayerRemoved(string userId, Player player)
 456        {
 0457            if (!usersInfoMarkers.TryGetValue(userId, out PoolableObject go))
 458            {
 0459                return;
 460            }
 461
 0462            usersInfoPool.Release(go);
 0463            usersInfoMarkers.Remove(userId);
 0464        }
 465
 466        private void ConfigureUserIcon(GameObject iconGO, Vector3 pos)
 467        {
 0468            var gridPosition = Utils.WorldToGridPositionUnclamped(pos);
 0469            iconGO.transform.localPosition = MapUtils.CoordsToPosition(Vector2Int.RoundToInt(gridPosition));
 0470        }
 471
 0472        private void OnCharacterRotate(Vector3 current, Vector3 previous) { UpdateRendering(Utils.WorldToGridPositionUnc
 473
 474        public void OnCharacterSetPosition(Vector2Int newCoords, Vector2Int oldCoords)
 475        {
 0476            if (oldCoords == newCoords)
 0477                return;
 478
 0479            UpdateRendering(new Vector2((float)newCoords.x, (float)newCoords.y));
 0480        }
 481
 482        public void UpdateRendering(Vector2 newCoords)
 483        {
 3484            UpdateBackgroundLayer(newCoords);
 3485            UpdateSelectionLayer();
 3486            UpdateOverlayLayer();
 3487        }
 488
 6489        void UpdateBackgroundLayer(Vector2 newCoords) { atlas.CenterToTile(newCoords); }
 490
 491        void UpdateSelectionLayer()
 492        {
 493            //TODO(Brian): Build and place here the scene highlight if applicable.
 3494        }
 495
 496        void UpdateOverlayLayer()
 497        {
 498            //NOTE(Brian): Player icon
 3499            Vector3 f = CommonScriptableObjects.cameraForward.Get();
 3500            Quaternion playerAngle = Quaternion.Euler(0, 0, Mathf.Atan2(-f.x, f.z) * Mathf.Rad2Deg);
 501
 3502            var gridPosition = playerGridPosition;
 3503            playerPositionIcon.anchoredPosition = MapUtils.CoordsToPositionWithOffset(gridPosition);
 3504            playerPositionIcon.rotation = playerAngle;
 3505        }
 506
 507        // Called by the parcelhighlight image button
 508        public void ClickMousePositionParcel()
 509        {
 0510            highlightedParcelText.text = string.Empty;
 0511            lastClickedCursorMapCoords = cursorMapCoords;
 0512            OnParcelClicked?.Invoke(cursorMapCoords.x, cursorMapCoords.y);
 0513        }
 514    }
 515}

Methods/Properties

MapRenderer()
i()
i(DCL.MapRenderer)
playerRotation()
playerGridPosition()
usersPositionMarkerController(DCL.MapGlobalUsersPositionMarkerController)
usersPositionMarkerController()
parcelHighlightEnabled(System.Boolean)
parcelHighlightEnabled()
otherPlayers()
Awake()
Update()
OnDestroy()
Initialize()
MoveHomePointIcon(UnityEngine.Vector2Int, UnityEngine.Vector2Int)
InitializeHomePointIcon()
EnsurePools()
SetParcelHighlightActive(System.Boolean)
GetParcelHighlightTransform()
SetOtherPlayersIconActive(System.Boolean)
SetPlayerIconActive(System.Boolean)
SetHighlighSize(UnityEngine.Vector2Int)
SetHighlightStyle(MapParcelHighlight/HighlighStyle)
Cleanup()
CleanLandsHighlights()
ClearLandHighlightsInfo()
SelectLand(UnityEngine.Vector2Int, UnityEngine.Vector2Int)
HighlightLands(System.Collections.Generic.List[Vector2Int], System.Collections.Generic.List[Vector2Int])
CreateHighlightParcel(UnityEngine.UI.Image, UnityEngine.Vector2Int, UnityEngine.Vector2Int)
UpdateCursorMapCoords()
IsCursorOverMapChunk()
UpdateParcelHighlight()
UpdateParcelHold()
OnKernelConfigChanged(KernelConfigModel, KernelConfigModel)
CoordinatesAreInsideTheWorld(System.Int32, System.Int32)
MapRenderer_OnSceneInfoUpdated(MinimapMetadata/MinimapSceneInfo)
SetPointOfInterestActive(System.Boolean)
IsEmptyParcel(MinimapMetadata/MinimapSceneInfo)
OnOtherPlayersAdded(System.String, Player)
OnOtherPlayerRemoved(System.String, Player)
ConfigureUserIcon(UnityEngine.GameObject, UnityEngine.Vector3)
OnCharacterRotate(UnityEngine.Vector3, UnityEngine.Vector3)
OnCharacterSetPosition(UnityEngine.Vector2Int, UnityEngine.Vector2Int)
UpdateRendering(UnityEngine.Vector2)
UpdateBackgroundLayer(UnityEngine.Vector2)
UpdateSelectionLayer()
UpdateOverlayLayer()
ClickMousePositionParcel()