Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit 2c147df

Browse files
committed
feat: GetModelsForEdit
1 parent 9eca5f3 commit 2c147df

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.releaserc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}],
1010
["@semantic-release/npm", { "npmPublish": false, "pkgRoot": "Packages/com.nuclearband.sodatabase" }],
1111
["@semantic-release/git", {
12-
"assets": ["Packages/com.nuclearband.sodatabase/package.json", "Packages/ccom.nuclearband.sodatabase/CHANGELOG.md"],
12+
"assets": ["Packages/com.nuclearband.sodatabase/package.json", "Packages/com.nuclearband.sodatabase/CHANGELOG.md"],
1313
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
1414
}],
1515
["@semantic-release/exec", {

Packages/com.nuclearband.sodatabase/Runtime/SODatabaseInternal.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#if UNITY_EDITOR
2+
using System.Collections.Generic;
3+
using System.Linq;
24
using UnityEditor;
35
using UnityEngine;
46

@@ -11,6 +13,13 @@ public static T GetModelForEdit<T>(string path) where T : DataNode
1113
return AssetDatabase.LoadAssetAtPath(SODatabaseSettings.Path + path + ".asset", typeof(T)) as T;
1214
}
1315

16+
public static List<T> GetModelsForEdit<T>(string path) where T : DataNode
17+
{
18+
var modelGUIDs = AssetDatabase.FindAssets($"t:{typeof(T).Name}",new [] {SODatabaseSettings.Path + path});
19+
20+
return modelGUIDs.Select(model => AssetDatabase.LoadAssetAtPath<T>(AssetDatabase.GUIDToAssetPath(model))).ToList();
21+
}
22+
1423
public static void CreateFolder(string path)
1524
{
1625
var folders = path.Split('/');

0 commit comments

Comments
 (0)