Hey guys,
I try to create an inventory system for my game and everything works so far. But there ist still a problem left! I draw my inventory by:
C#:
public void OnGUI() {
GUI.skin = skin;
if(draw) {
int i = 0;
for(int x = 0; x < slotsY; x++) {
for(int y = 0; y < slotsX; y++) {
GUI.Box(new Rect(y * 42, x * 42, 40, 40), inventory*.itemName, skin.GetStyle("slot"));*
_ GUI.DrawTexture(new Rect(y * 42, x * 42, 40, 40), inventory*.texture);_
_ i++;_
_ }*_
* }*
* }*
* }*
and now I want to know how to listen for a click on the boxes and how to find out which box / slot was clicked.
Hope you can help me! Thanks in advance