Last active
January 29, 2018 18:53
-
-
Save ianwaldrop/6af32128bf3b09581fc8 to your computer and use it in GitHub Desktop.
Editor script to find all project assets of the given type.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<T> FindAssetsOfType<T> () where T : UnityEngine.Object | |
{ | |
return AssetDatabase.FindAssets ("t:" + typeof (T).Name) | |
.Select (AssetDatabase.GUIDToAssetPath) | |
.Select ((T)AssetDatabase.LoadMainAssetAtPath); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment