Adding metadata to imported image?

So I’m making a game where you can customize your character by putting sprites into the streamingAssets folder, and the game will load the sprites into the game.
Right now, each sprite has to be saved as an individual image and imported one-by-one, but I’m trying to make a system where you can make just import 1 large image, and the game will automatically apply spritesheet settings.

Here’s what I’ve got right now. It checks the streamingAssets folder for any image with the filename containing the word “head”, and if so, it turns it into one of the optional sprites for your character’s head.

But as you can see, at this rate I’ll have to do the same for every single body part. So how can I take a sprite from streamingAssets and apply metadata for a spritesheet?


public void LoadFiles()
path = Application.streamingAssetsPath;
DirectoryInfo dir = new DirectoryInfo(path);
FileInfo fileinfo = dir.GetFiles();
foreach (FileInfo files in fileinfo)
if (files.Name.Contains(“head”))
//converts fileinfo into sprite
byte bytes = File.ReadAllBytes(files.FullName);//Location is set before hand

                Debug.LogError("byte array");
                Texture2D imgTexture = new Texture2D(900, 900, TextureFormat.DXT1, false);
                imgTexture.filterMode = FilterMode.Bilinear;
                Sprite head1 = Sprite.Create(imgTexture, new Rect(0, 0, 900, 900), new Vector2(0f, 0f), 1.0f);

Short of being able to add custom metadata, I did learn that I can slice my own spritesheet at runtime.
After importing the Texture2d, I can make a sprite like so:
Sprite head1 = Sprite.Create(imgTexture, new Rect(0, 0, 350, 350), new Vector2(0f, 0f), 1.0f);

And I can do this multiple times for the same sprite. So if I made a spritesheet, I can check the metadata in the inspector, and just read the values of each sprite. Then when I cut sprites at runtime, I can make them match the same position and size of the ones on the spritesheet.