This commit is contained in:
2025-05-26 17:04:33 +02:00
parent f0536f4129
commit 6bda371baa
303 changed files with 1361 additions and 1372 deletions

32
Editor/Utils/AssetDatabaseEx.cs Normal file → Executable file
View File

@@ -1,17 +1,17 @@
using UnityEditor;
using UnityEngine;
namespace RebootKitEditor.Utils {
public static class AssetDatabaseEx {
public static T[] LoadAllAssets<T>() where T : Object {
string[] guids = AssetDatabase.FindAssets($"t:{typeof(T).Name}");
T[] assets = new T[guids.Length];
for (int i = 0; i < guids.Length; i++) {
string path = AssetDatabase.GUIDToAssetPath(guids[i]);
assets[i] = AssetDatabase.LoadAssetAtPath<T>(path);
}
return assets;
}
}
using UnityEditor;
using UnityEngine;
namespace RebootKitEditor.Utils {
public static class AssetDatabaseEx {
public static T[] LoadAllAssets<T>() where T : Object {
string[] guids = AssetDatabase.FindAssets($"t:{typeof(T).Name}");
T[] assets = new T[guids.Length];
for (int i = 0; i < guids.Length; i++) {
string path = AssetDatabase.GUIDToAssetPath(guids[i]);
assets[i] = AssetDatabase.LoadAssetAtPath<T>(path);
}
return assets;
}
}
}