Skip to content

Instantly share code, notes, and snippets.

@rittikornt
rittikornt / EditorFindAllAssetsInProject.cs
Created March 3, 2022 07:28
Find all ScriptableObject in the Unity Project
public static T[] LoadAllAssetAtPath<T>(string fullFolderPath, string prefix, string postfix, List<T> list = null) where T : UnityEngine.Object
{
string searchPattern = prefix + "*" + postfix;
string[] filePaths = Directory.GetFiles(fullFolderPath
, searchPattern, SearchOption.AllDirectories);
//System.Array.Sort(filePaths);
Debug.Log($"Found {filePaths.Length} paths to check for search pattern: \"{searchPattern}\"");
if (list == null)
{