L
L
Layen2017-10-01 20:19:22
Unity
Layen, 2017-10-01 20:19:22

How to assign a keyboard button to a specific sprite?

Urgent, need help: how to assign a button to a specific sprite?
Need to assign a sprite to the z button, how?
Here's a snippet of a crude example:
Dictionary dict = new Dictionary();
dict.Add(KeyCode.Z, );

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ark Tarusov, 2017-10-02
@Layen

What should be done when the button is pressed?
Can be an array or a list of sprites

List<Sprite> img = new List<Sprite>();
Dictionary dict = new Dictionary();
dict.Add(KeyCode.Z, img[0]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question