Example #1
0
 private void UpdateMarker(Vector3 position)
 {
     mapMarker?.Kill();
     mapMarker        = GameManager.server.CreateEntity("assets/prefabs/tools/map/genericradiusmarker.prefab", position) as MapMarkerGenericRadius;
     mapMarker.alpha  = 0.8f;
     mapMarker.color1 = Color.red;
     mapMarker.color2 = Color.red;
     mapMarker.radius = 2;
     mapMarker.Spawn();
     mapMarker.SendUpdate();
 }
Example #2
0
        private void GenerateMarkers()
        {
            // Generate the map marker
            // Clear all the previously generated map markers
            if (dropradius != null)
            {
                foreach (var paire in dropradius)
                {
                    MapMarkerGenericRadius MapMarkerDel = paire.Value;

                    if (MapMarkerDel != null)
                    {
                        MapMarkerDel.Kill();
                        MapMarkerDel.SendUpdate();
                    }
                }
            }

            // For each of the drops, generate a marker on the map
            foreach (var paire in dropposition)
            {
                // Variables needed
                Vector3 position = paire.Value;
                bool    looted;
                lootedornot.TryGetValue(paire.Key, out looted);
                MapMarkerGenericRadius MapMarker = GameManager.server.CreateEntity("assets/prefabs/tools/map/genericradiusmarker.prefab", position) as MapMarkerGenericRadius;

                // Check if map marker was generated, if not end this whole function because there was an error
                if (MapMarker == null)
                {
                    return;
                }

                // Set the marker's color and alpha
                MapMarker.alpha  = mapMarkerAlpha;
                MapMarker.color1 = markerColor;

                // Set the color to looted if the crate has already been looted
                if (looted)
                {
                    MapMarker.color1 = markerLootedColor;
                }

                MapMarker.color2 = Color.black;                 // I honestly dont know why is this here

                // Set the marker's radius
                MapMarker.radius = mapmarkerradius;

                // Remove the previous marker data if there is then add the new one
                dropradius.Remove(paire.Key);
                dropradius.Add(paire.Key, MapMarker);
            }

            // Spawn the markers
            foreach (var markers in dropradius)
            {
                markers.Value.Spawn();
                markers.Value.SendUpdate();
            }
        }
Example #3
0
            private void DespawnMarker()
            {
                if (!IsValid(_marker))
                {
                    return;
                }

                _marker.SetParent(null);
                _marker.Kill();
            }
        private void OnEntityKill(StashContainer stash)
        {
            _stashes.Remove(stash);
            List <MapMarkerGenericRadius> playerMarkers = _mapMarker[stash.OwnerID];
            MapMarkerGenericRadius        marker        = playerMarkers?.FirstOrDefault(m => m.transform.position == stash.transform.position);

            if (marker == null || marker.IsDestroyed)
            {
                return;
            }
            marker.Kill();
            playerMarkers.Remove(marker);
        }
 void GenerateMarkers()
 {
     if (dropradius != null)
     {
         foreach (var paire in dropradius)
         {
             MapMarkerGenericRadius MapMarkerDel = paire.Value;
             if (MapMarkerDel != null)
             {
                 MapMarkerDel.Kill(); MapMarkerDel.SendUpdate();
             }
         }
     }
     foreach (var paire in dropposition)
     {
         Vector3 position;
         position = paire.Value;
         bool looted;
         lootedornot.TryGetValue(paire.Key, out looted);
         MapMarkerGenericRadius MapMarker = GameManager.server.CreateEntity("assets/prefabs/tools/map/genericradiusmarker.prefab", position) as MapMarkerGenericRadius;
         if (MapMarker == null)
         {
             return;
         }
         MapMarker.alpha  = 0.4f;
         MapMarker.color1 = Color.magenta;
         if (looted)
         {
             MapMarker.color1 = Color.cyan;
         }
         MapMarker.color2 = Color.black;
         MapMarker.radius = mapmarkerradius;
         dropradius.Remove(paire.Key);
         dropradius.Add(paire.Key, MapMarker);
         if (debug)
         {
             Puts($"CARGO MARKER ADDED IN DICO");
         }
     }
     foreach (var markers in dropradius)
     {
         markers.Value.Spawn();
         markers.Value.SendUpdate();
     }
 }
        void CanSeeStash(BasePlayer player, StashContainer stash)
        {
            List <MapMarkerGenericRadius> playerMarkers;

            if (!_mapMarker.TryGetValue(player.userID, out playerMarkers))
            {
                _mapMarker.Add(player.userID, playerMarkers = new List <MapMarkerGenericRadius>());
            }

            MapMarkerGenericRadius marker = playerMarkers?.FirstOrDefault(m => m.transform.position == stash.transform.position);

            if (marker == null || marker.IsDestroyed)
            {
                return;
            }
            marker.Kill();
            playerMarkers.Remove(marker);
        }
Example #7
0
        void GenerateMarkers()
        {
            if (baseradius != null)
            {
                foreach (var paire in baseradius)
                {
                    MapMarkerGenericRadius MapMarkerDel = paire.Value;
                    if (MapMarkerDel != null)
                    {
                        MapMarkerDel.Kill();
                        MapMarkerDel.SendUpdate();
                    }
                }
            }


            foreach (var nelico in baseposition)
            {
                Vector3 position = nelico.Value;
                MapMarkerGenericRadius MapMarker = GameManager.server.CreateEntity("assets/prefabs/tools/map/genericradiusmarker.prefab", position) as MapMarkerGenericRadius;
                MapMarker.alpha  = 0.6f;
                MapMarker.color1 = Color.red;
                MapMarker.color2 = Color.black;
                MapMarker.radius = 8;

                baseradius.Remove(nelico.Key);
                baseradius.Add(nelico.Key, MapMarker);

                if (debug == true)
                {
                    Puts($"PATROL MARKER SPAWNED ON MAP");
                }
            }

            foreach (var paire in baseradius)
            {
                paire.Value.Spawn();
                paire.Value.SendUpdate();
            }
        }
 private void UpdateMarker()
 {
     _marker.Kill();
     _marker.Spawn();
     _marker.SendUpdate();
 }
 private void Unload() => _marker?.Kill();