using System.Collections; using System.Collections.Generic; using UnityEngine; #if UNITY_EDITOR using UnityEditor; #endif namespace BITKit { public static class ScriptableObjectHelper { public static T Get() where T : ScriptableObject { string name = typeof(T).Name; T so = Resources.Load(name); #if UNITY_EDITOR if (so is null) { so = ScriptableObject.CreateInstance(); AssetDatabase.CreateAsset(so, $"Assets/Resources/{name}.asset"); AssetDatabase.SaveAssets(); } #endif return so; } } }