using System.Collections; using System.Collections.Generic; using UnityEngine.UI; using UnityEngine; [RequireComponent(typeof(Dropdown))] public class ThemeSelector : MonoBehaviour { public Gradient[] themeList; public static Gradient theme; public Preferences preferences; void Awake() { theme = themeList[preferences.data.themeIndex]; gameObject.GetComponent().value = preferences.data.themeIndex; } public void SelectTheme(Dropdown d) { theme = themeList[d.value]; preferences.data.SetThemeIndex(d.value); } public Gradient CurrentTheme() { return theme; } }