This commit is contained in:
CortexCore
2024-06-11 15:39:09 +08:00
parent 3e8bd54a08
commit 0e1bf20595
3 changed files with 86 additions and 26 deletions

View File

@@ -15,6 +15,7 @@ namespace BITKit.GameEditor
public class ScriptableObjectGroupEditor<T> : EditorWindow where T : ScriptableObject
{
protected virtual string AssetsPath => $"Assets/Artists/";
protected virtual string ExportPathKey => $"{typeof(T).Name}.ExportPath";
protected readonly List<T> List=new();
private ListView _listView;
@@ -105,15 +106,26 @@ namespace BITKit.GameEditor
private void ExportData()
{
var exportPath = EditorUtility.OpenFolderPanel("select path", "",typeof(T).FullName);
var path = Environment.CurrentDirectory;
if (PlayerPrefs.HasKey(ExportPathKey))
{
path = PlayerPrefs.GetString(ExportPathKey);
}
var exportPath = EditorUtility.SaveFilePanel("select path", path, $"{typeof(T).Name}.bytes", "bytes");
if(string.IsNullOrEmpty(exportPath))return;
PlayerPrefs.SetString(ExportPathKey, exportPath);
PlayerPrefs.Save();
ExportData(exportPath);
}
protected virtual void ExportData(string path)
{
throw new NotImplementedException($"暂未实现{typeof(T).Name}的导出功能");
}
protected virtual void ItemsChosen(IEnumerable<object> obj)