/// <summary> Loads the active variant of the given theme from the PlayerPrefs </summary> /// <param name="theme"> Target theme </param> public static void LoadActiveVariant(ThemeData theme) { if (theme == null) { return; } if (DataUtils.PlayerPrefsHasKey(theme.Id.ToString())) { theme.ActivateVariant(new Guid(DataUtils.PlayerPrefsGetString(theme.Id.ToString()))); } else { SaveActiveVariant(theme); } }
/// <summary> Activate the variant by name in the theme with the given name </summary> /// <param name="themeName"> Theme name to search for (the theme where the variant can be found) </param> /// <param name="variantName"> Variant name to search for (in the theme with the given name) </param> public static void ActivateVariant(string themeName, string variantName) { if (!s_initialized) { Init(); } ThemeData theme = Instance.GetTheme(themeName); if (theme == null) { return; } theme.ActivateVariant(variantName); UpdateTargets(theme); if (!AutoSave) { return; } SaveActiveVariant(theme); DataUtils.PlayerPrefsSave(); }