preferences json save

This commit is contained in:
ntr committed 2022-03-31 17:38:22 +11:00
1 parent a32a10afe6
commit fb18bc08d1
3 files changed
+236 -204

No files matched your search

+5 -2
View File
@@ -3,17 +3,20 @@ 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() {
if (theme == null) theme = themeList[0];
theme = themeList[preferences.data.themeIndex];
gameObject.GetComponent<Dropdown>().value = preferences.data.themeIndex;
}
public void SelectTheme(Dropdown d) {
Debug.Log($"{d.value}");
theme = themeList[d.value];
preferences.data.SetThemeIndex(d.value);
}
public Gradient CurrentTheme() {