// // Unity Methods // private IEnumerator Start() { yield return(WaitFor.Frames(WaitFor.InitialFrames)); // Get Mapbox layer controller var map = ComponentManager.Instance.Get <MapController>(); mapboxController = map.GetLayerController <MapboxLayerController>(); int selectedMapboxIndex = mapboxController.BackgroundIndex; bool mapboxEnabled = selectedMapboxIndex >= 0; AddBackground(-1, "None", selectedMapboxIndex == -1); // Check if Mapbox is ready if (mapboxEnabled) { selectedIndex = selectedMapboxIndex; AddBackgrounds(); AddSpecialBackgrounds(); } else { mapboxController.OnReady += OnMapboxControllerReady; } }
// // Unity Methods // private IEnumerator Start() { toggle.onValueChanged.AddListener((isOn) => OnShowBackgroundPanel(isOn)); yield return(WaitFor.Frames(WaitFor.InitialFrames)); // Get Mapbox layer controller var map = ComponentManager.Instance.Get <MapController>(); mapboxController = map.GetLayerController <MapboxLayerController>(); int selectedMapboxIndex = mapboxController.BackgroundIndex; bool mapboxEnabled = selectedMapboxIndex >= 0; AddBackground(-1, Translator.Get("None"), selectedMapboxIndex == -1); // Check if Mapbox is ready if (mapboxEnabled) { selectedIndex = selectedMapboxIndex; AddBackgrounds(); AddSpecialBackgrounds(); } else { mapboxController.OnReady += OnMapboxControllerReady; } }