I want to have a set of sprites within a folder, and then be able to reference them from a dictionary by giving each of them a number. I want to do it like this so that I can have a variable for “Stance” that tells if the character is crouching, standing, or jumping, and will then add the stance plus the sprites number to get a resultant sprite number. So a punch might start on frame Sprite_05, but the jumping punch would start at Sprite_15. There is probably a better way to do this, and Im open to ideas.
Currently Im struggling to make DirectoryInfo work, because thats what ive found on these forums so far.
Can someone tell me where to start with something like this?
Better way is to make prefabs out of what you need. This lets you add custom knowledge at editor time when a) you can check it, and b) performance isn’t a consideration.
Then in the game just load or switch to whatever you need. Animation is extremely well-covered in tutorials.
It will never work. The entire directory structure in your project is obliterated and the assets selected to go into your build are “baked” into another format tailored to performant loading on whatever target you’re on.
You may be able to use Resources.Load() or Resources.LoadAll() to dynamically load content out of your game, but again, that is very fiddly and code- and organization-centric. It’s always better to simply make the parts you need, then load those parts.
If you go with Resources.Load(), be sure to start with the docs or you’ll waste a lot of time.