AssetSettingsProvider
を利用すると ScriptableObject をそのまま設定画面に表示することができる
1 階層 深くなりますがアセットを探す手間が省けて便利です
using System.Collections.Generic; using UnityEditor; using UnityEngine; public class SampleScriptableObject : ScriptableObject { } public class ScriptableObjectSettingsProvider : SettingsProvider { private ScriptableObjectSettingsProvider() : base("Project/Sample", SettingsScope.Project) { } [SettingsProviderGroup] private static SettingsProvider[] CreateSettingsProvider() { var providers = new List<SettingsProvider> { new ScriptableObjectSettingsProvider() }; if (Load() != null) { var provider = new AssetSettingsProvider("Project/Sample/Settings", Load); providers.Add(provider); } return providers.ToArray(); } private static SampleScriptableObject Load() { return Resources.Load<SampleScriptableObject>(""); } public override void OnGUI(string searchContext) { } }