Ejemplo n.º 1
0
        /// <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();
        }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
0
        /// <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();
        }