Files
kaiju/Assets/Util/ThemeSelector.cs
T
2022-05-31 15:39:24 +10:00

29 lines
765 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;
[SerializeField, ColorUsage(showAlpha: true, hdr: true)]
private Color hdrColor;
void Start() {
gameObject.GetComponent<Dropdown>().value = preferences.data.themeIndex;
theme = themeList[preferences.data.themeIndex];
}
public void SelectTheme(Dropdown d) {
theme = themeList[d.value];
preferences.SetThemeIndex(d.value);
}
public Gradient CurrentTheme() {
return theme;
}
}