Example #1
0
        /// <summary>
        /// Applies a theme to an element and its children
        /// </summary>
        public void ApplyThemeRecurse(Transform root, UIThemeAsset theme)
        {
            if (CoreParams.UIThemeMode == UIThemePolicy.Disabled || theme == null)
            {
                return;
            }

            ThemeEngine.ApplyThemeToAll(root, theme);
        }
Example #2
0
        /// <summary>
        /// Applies a theme to an element
        /// </summary>
        public void ApplyTheme(Transform element, UIThemeAsset theme)
        {
            if (CoreParams.UIThemeMode == UIThemePolicy.Disabled || theme == null)
            {
                return;
            }

            ThemeEngine.ApplyThemeToElement(element, theme);
        }
Example #3
0
        /// <summary>
        /// Applies a theme to an element and its children
        /// </summary>
        public void ApplyThemeRecurse(Transform root, UIThemeAsset theme)
        {
            if (CoreParams.UIThemeMode == UIThemePolicy.Disabled)
            {
                LogWarning($"Can't apply theme to element because theme engine is disabled!");
                return;
            }

            if (theme == null)
            {
                LogWarning($"Can't apply theme to element because theme is null!");
                return;
            }

            ThemeEngine.ApplyThemeToAll(root, theme);
        }