26 lines
672 B
C#
26 lines
672 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 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;
|
|
}
|
|
}
|