Guest User

Untitled

a guest
Nov 20th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using UnityEditor;
  4. using UnityEngine;
  5.  
  6. public static class Util
  7. {
  8. public static IEnumerable<T> LoadAssetsOfType<T>() where T : Object
  9. {
  10. return AssetDatabase.FindAssets($"t:{typeof(T).Name}")
  11. .Select(AssetDatabase.GUIDToAssetPath)
  12. .Select(AssetDatabase.LoadAssetAtPath<T>);
  13. }
  14. }
Add Comment
Please, Sign In to add comment