Files
kaiju/Assets/ThemeSelector.cs
T
2022-03-31 17:38:22 +11:00

26 lines
677 B
C#

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<Dropdown>().value = preferences.data.themeIndex;
}
public void SelectTheme(Dropdown d) {
theme = themeList[d.value];
preferences.data.SetThemeIndex(d.value);
}
public Gradient CurrentTheme() {
return theme;
}
}