Question by
MrabEzreb · Oct 15, 2016 at 05:53 PM ·
2dspritespritesspritesheet
How to access individual sprites by name when running a "right-click on asset" menuitem?
I am creating a 2D game and am using LPC spritesheets for my characters. I am using bitcula's importer script to automatically slice and name each sprite.
I am now writing a script that will generate an AnimationController with the proper animations, which I have made appear in the asset context menu using [MenuItem("Assets/Generate Animations")].
How do I access the sliced sprites by name? So far I have been able to get a Texture2D (the asset) and a TextreImporter (used by the bitcula script to slice the asset). It seems to me that the TextureImporter shouldn't be used, since I am not extending AssetPostprocessor (bitcula's script does).
My question is, how do I access individual sprites from the right clicked asset?
Comment