Hi everyone, I’m trying to make my number keys work with a for loop. But it doesn’t appear to be working. Any idea what’s wrong with it?
public int someInt;
void OnGUI() {
//for (int i = 0; i < 9; i++){
if (Event.current.type == EventType.KeyDown) {
if (Event.current.keyCode >= KeyCode.Alpha1
&& Event.current.keyCode <= KeyCode.Alpha9) {
someInt = i;
Event.current.Use();
}
}
}
}