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