I tryed a few things.
Test A :
- the Online Maps Buildings component is enabled before launching app
- i launch the app
- i disable the Online Maps Buildings component via code directly in a Start() method
- later i will enabled the component via code
-the buildings appears correctly
- i disable the component again
- the buildings does disappear
- after half a second the buildings are back in the scene.
Test B:
- the Online Maps Buildings component is disabled before launching app
- i launch the app
- later i will enabled the component via code
-the buildings appears correctly
- i disable the component again
- the buildings does disappear, and they don't come back until i enable the component again
The reason i was going for test A is that i was trying to enable / disable the component by doing :
public void use_Buildings(bool b)
{
OnlineMapsBuildings.instance.enabled = b;
}
And this throw an error since the onlineMapsBuildings instance does'nt exist yet if i launch the app without it being enabled.
using this :
public void use_Buildings(bool b)
{
OnlineMaps.instance.GetComponent<OnlineMapsBuildings>().enabled = b;
}
Allow me to do "test B" and so my problem is solved.
Note that in both case, a new gameobject named "buildings" (which become the parent of all the buildins) is created each time i enable the component.
Hope this feedback is usefull