updating imported asset with script

Im creating jpeg files for texture (gabor patch) in matlab. I’m saving them in asset folder. Is there a way to update this folder in my script? so I create this file in matlab, gets saved in asset, and script check to see if any new image added and if did, change the texutre to latest

Name your textures in a way that will sort them from new to old. For example putting “0” in front of the name of your texture will put it at the top of your texture folder in unity.

Then:

private Object[] textures;

void Start(){
textures = Resources.LoadAll("Textures", typeof(Texture2D));\
textures.Sort();
yourTexture = textures[0];
}

Have not tried this code but that is the general idea. Not sure if this is the best way either, since you are going to have to order your textures by name.