Scriptable Objects
Find all ScriptableObjects of type
// Use AssetDatabase.FindAssets to first get all of the GUIDs of the ScriptableObjects
string[] guids = AssetDatabase.FindAssets(string.Concat("t:", typeof(FootstepGroundTypePreset).Name));
// Then you can use language-integrated query's 'Select' operation to project the GUIDs to the desired ScriptableObjects
IEnumerable<FootstepGroundTypePreset> allPresets =
guids.Select(guid => AssetDatabase.LoadAssetAtPath<FootstepGroundTypePreset>(AssetDatabase.GUIDToAssetPath(guid)));
// In short, you can do the following
IEnumerable<FootstepGroundTypePreset> allPresets =
AssetDatabase.FindAssets(string.Concat("t:", typeof(FootstepGroundTypePreset).Name))
.Select(guid => AssetDatabase.LoadAssetAtPath<FootstepGroundTypePreset>(AssetDatabase.GUIDToAssetPath(guid)));
No Comments