/// <summary> /// Resets the map to our default rendering style. /// </summary> public void OnReset() { useMetaDataAsFilters.isOn = false; for (int i = 0; i < panels.Count; i++) { IStyleConfigView viewConfig = panels[i].GetComponent <IStyleConfigView>(); if (viewConfig != null) { viewConfig.Reset(); } } OnApplyStyle(); }
private void ApplyCustomStyles(GameObjectOptions options) { if (options == null) { return; } for (int i = 0; i < panels.Count; i++) { IStyleConfigView viewConfig = panels[i].GetComponent <IStyleConfigView>(); if (viewConfig != null) { viewConfig.ApplyStyle(options); } } }
/// <summary> /// Applies the style on start. /// </summary> public IEnumerator Init() { // Wait on BaseMapLoader to be setup yield return(new WaitUntil(() => BaseMapLoader.IsInitialized)); // Make to create a new GameObjectOptions // This is done to preserve the default styleoptions object assigned in BaseMapLoader // as we'll reuse it in the Reset function BaseMapLoader.RenderingStyles = new GameObjectOptions(); SetDefaultStyles(BaseMapLoader.RenderingStyles); // Initialize all config panels for (int i = 0; i < panels.Count; i++) { IStyleConfigView viewConfig = panels[i].GetComponent <IStyleConfigView>(); if (viewConfig != null) { viewConfig.InitConfig(); } } OnApplyStyle(); }