- Home /
How does one get the name for a sprite that is shown in the project window?
Coding a tool for the editor, and can't seem to find where that name is stored. Sprite inherits a name variable from Object, but that gives me a null reference when I call it. Thanks guys!
Comment
If your sprite(s) are in a known folder, you can use:
string[] sprites = Directory.GetFiles(yourPathStr, "*.png");
Path.GetFileNameWithoutExtension(sprites[i]);