31 lines
754 B
C#
31 lines
754 B
C#
using System.IO;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[ExecuteAlways]
|
|
public class Preferences : MonoBehaviour {
|
|
public ThemeSelector themeSelector;
|
|
public PreferenceData data;
|
|
|
|
void Awake() {
|
|
string path = Path.Combine(Application.persistentDataPath, "preferences.json");
|
|
data = new PreferenceData(path).Load();
|
|
// Debug.Log($"ThemeIndex {data.themeIndex}");
|
|
}
|
|
|
|
public void SetThemeIndex(int i) {
|
|
data.themeIndex = i;
|
|
data.Save();
|
|
}
|
|
|
|
public void SetUseLoopback(bool v) {
|
|
data.useLoopback = v;
|
|
data.Save();
|
|
}
|
|
|
|
public Gradient Theme() {
|
|
return themeSelector.CurrentTheme();
|
|
}
|
|
}
|