private static List <ObjectHolder> LoadAllSprites(string fullpath) { var holders = new List <ObjectHolder>(); string[] spritepaths = Directory.GetFiles(fullpath, "*.png", SearchOption.AllDirectories); foreach (var spritepath in spritepaths) { var assetpath = spritepath.Replace("\\", "/").Replace(Application.dataPath, "Assets"); var sprite = AssetDatabase.LoadAssetAtPath <Sprite>(assetpath); if (sprite != null) { var holder = new ObjectHolder(sprite); holders.Add(holder); } } return(holders); }