preferences json save
This commit is contained in:
1 parent
a32a10afe6
commit
fb18bc08d1
3 files changed
+236
-204
No files matched your search
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user