Closed cafigz closed 2 years ago
Are you adding the MapPins to a MapPinLayer? If so, before destroying the pins, try removing them from the MapPinLayer's MapPins
collection.
Hi! How should I do that? What's the method to remove a mapPin from the MapPins list? Best regards
Got it to work, thanks! All I had to do was: _mapPinLayer.MapPins.Clear();
Hi! Thanks for answering. How should I do that? What is the method to remove the MapPin from them MapPins list? Thanks in advance!
Obter o Outlook para Androidhttps://aka.ms/AAb9ysg
From: kircher1 @.> Sent: Monday, June 27, 2022 6:42:39 PM To: microsoft/MapsSDK-Unity @.> Cc: cafigz @.>; State change @.> Subject: Re: [microsoft/MapsSDK-Unity] Can't destroy MapPin prefabs (Issue #177)
Are you adding the MapPins to a MapPinLayer? If so, before destroying the pins, try removing them from the MapPinLayer's MapPins collection.
— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/MapsSDK-Unity/issues/177#issuecomment-1167667314, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYWGARYMHSWSUZSUPS7MMPDVRHRY7ANCNFSM5Z4ZJLHQ. You are receiving this because you modified the open/close state.Message ID: @.***>
Hi!
I'm instantiating Map Pins from a database. I want to be able to add/remove prefabs during runtime, but whenever I try to destroy the Prefabs I get these errors:
var mapPin = Instantiate(_mapPinPrefab); mapPin.tag = "MapPinPrefab"; mapPinsCreatedThisFrame.Add(mapPin);
public void DestroyAllPrefabs() { int i = 0; foreach (GameObject gameObject in GameObject.FindGameObjectsWithTag("MapPinPrefab")) { Destroy(gameObject); } }