Need to use TextureImporter to import resources, call the following code
TextureImporter importer = (TextureImporter)TextureImporter.GetAtPath(path);
importer.textureType = TextureImporterType.Sprite;
AssetDatabase.Refresh();
Need to use TextureImporter to import resources, call the following code
TextureImporter importer = (TextureImporter)TextureImporter.GetAtPath(path);
importer.textureType = TextureImporterType.Sprite;
AssetDatabase.Refresh();