Topic: Don't disable markers when map is off

Hello
I need to implement changing map markers state even when map is disable, but now I have problem with that due to deleting markers instances when map is disable. For now I solve the issue by comment this line

foreach (OnlineMapsMarker3D item in _items) item.DestroyInstance();

in OnlineMapsMarker3DManager class (line 153). I know that changing your scripts is bad practice so I need you help in implementation of this

Re: Don't disable markers when map is off

Hello.

Most likely you are looking for one of these:
http://infinity-code.com/doxygen/online … aac7ed8d01
http://infinity-code.com/doxygen/online … 3dc76b6b3b

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Don't disable markers when map is off

I'm not sure because it seems like your code examples refers me appeal to objects that deleted by code in OnDisable method of OnlineMapsMarker3DManager. But I'm looking opportuinity to not delete 3d markers when I disable my map with OnlineMapsMarker3DManager class attached on it

Re: Don't disable markers when map is off

I misunderstood your original problem.

Please explain in detail why you need to keep instances of markers when disable the map?
It is possible there is some other way.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Don't disable markers when map is off

First of all I need to say that I'm developing Android AR aplication.
I have map which correspond to real world and which user can enable and disable in any time, just like hint. Together with that I have 2 types of markers, let's say task marker and reward marker which must be shown on player's map. They have different color and destination. Also I have other gameobjects on my scene that player can interact with and which correspond to my markers. (these gameobjects are AR objects, that's how player can interact with them).
For example on player's map displaying 1 task marker (this marker indicates on real world location).Than he went to this marker and see gameobject. After that he click on this gameobject (that correspond to task), and than I give him description of this task (for example: "go to Evergreen terrace street and find your reward). After that description player may go to this street and find his reward (which is another gamobject that correspond to reward). Player can find place where this reward object locate by his map, just like with task object.

So the algorithm of actions is as follows:
player see task marker on map where located task gameobject->player go to this marker in real world by map->player click on gameobject that correspond to task->player see description of task->task marker is gone and reward marker is shown->player go to reward marker where located reward gameobject->player takes his reward by clicking on reward gameobject on scene

So I need to change state of markers on my minimap (disable task markers, show reward markers and vice versa). This works fine when my map is always enabled, because markers objects instatiated in scene. But when my map is disabled these objects deleted by OnlineMapsMarker3DManager script and I can't manipulate them.
To understand this try to imagine situation when player click on task gameobject with disabled map. By alghorithm task marker on map should be disabled and reward marker should be displayed. But at this moment map disabled (and 3d markers absent on scene) so I have nothing to manage
Hope I make it clear now

Re: Don't disable markers when map is off

You have four ways:
1. Do not use 3D markers, but position your GameObjects in the scene directly.
http://infinity-code.com/doxygen/online … 6316068362

2. After disabling the map, you cannot interact with the marker instance, but you can still interact with the marker fields, for example, change the location or prefab, get or set custom data.
Put something in the custom data, and take it when you enable the map.

3. Inherit OnlineMapsMarker3DManager class, override OnDisable and OnEnable methods, add it to another GameObject, and use it instead of OnlineMapsMarker3DManager.

4. Instead of disabling the map GameObject, disable MeshRenderer (hidden component).
This will just hide the map, but it will still work.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Don't disable markers when map is off

Thanks for response. I'll try