I have a file called Player.png (“Assets/Resources/Player/Player.png”). I sliced it with the Sprite Editor in tiles like: idle_up_2, move_right_0, move_jumpingdown_-19 etc… . Now I wanted to animate the Player by (obviously) changing his texture every x seconds he is moving in a direction. My question is: how can I get the Sprite’s slice, for ex. “idle_down”?
When you set a sprite’s type to Multiple and slice it, the sprite asset in your asset folder will have a little dropdown arrow – you can click that to see the individual sprite assets for each slice of that sprite.
Then, in your scripts, declare a public Sprite sprite;
or public Sprite[] sprites;
field. This will create a field in the inspector for a MonoBehaviour or ScriptableObject; you can drag your sprites to these fields and reference them in your scripts. You can read more about this subject here and here.