The simple answer is to load it. I found all files with Directory.GetFiles(). Then I choose all files name that i need. And load them with Resources.Load() then I tryed Resources.FindObjectsOfTypeAll() and again it is not finding all textures. How can i fix this?
Code difficult to read because the function get file “mask” and I finding for files with the same name to the separator “_” in the same directory.
For example:
Filename_0.tga
Filename_1.tga
Filename_2.tga
Filename_3.tga
Filename_4.tga
function (Texture2D mask)
string[] dirFiles = Directory.GetFiles( AssetDatabase.GetAssetPath( mask ).Remove( AssetDatabase.GetAssetPath( mask ).LastIndexOf( "/" ) ) );
string fileBaseName;
for ( int i = 0; i < dirFiles.Length; i++ ) {
fileBaseName = dirFiles[i].Substring( dirFiles[i].LastIndexOf( @"\" ) + 1 );
if ( fileBaseName.StartsWith( maskBaseName ) && !fileBaseName.EndsWith("meta")) {
Resources.Load( AssetDatabase.GetAssetPath( mask ).Remove( AssetDatabase.GetAssetPath( mask ).LastIndexOf( "/" ) ) + "/" + fileBaseName ) as Texture2D;
}
}