Files
RebootKit/Editor/Utils/AssetDatabaseEx.cs
2025-07-30 05:51:39 +02:00

17 lines
574 B
C#
Executable File

using UnityEditor;
using UnityEngine;
namespace RebootKit.Editor.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;
}
}
}