34 lines
846 B
C#
34 lines
846 B
C#
using System;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace Module.UIToolkit.Editor
|
|
{
|
|
[Serializable]
|
|
internal sealed class Settings
|
|
{
|
|
public bool collectionViewDisableMaxHeight = true;
|
|
|
|
private static Settings _settings;
|
|
|
|
internal static Settings Load()
|
|
{
|
|
if (_settings != null)
|
|
return _settings;
|
|
|
|
_settings = new Settings();
|
|
var json = EditorPrefs.GetString(nameof(Settings), string.Empty);
|
|
|
|
if (!string.IsNullOrEmpty(json))
|
|
JsonUtility.FromJsonOverwrite(json, _settings);
|
|
|
|
return _settings;
|
|
}
|
|
|
|
internal void Save()
|
|
{
|
|
var json = JsonUtility.ToJson(this);
|
|
EditorPrefs.SetString(nameof(Settings), json);
|
|
}
|
|
}
|
|
} |