public static void EventHandler(string script) { var e = new InputKeyboardEvent(script); switch (script) { case INPUT_KEYBOARD_BEFORE: BeforeKeyboardInput(e); break; case INPUT_KEYBOARD_AFTER: AfterKeyboardInput(e); break; } }
public int RegisterKeyboardInputHandler(KeyCode code, Action onInputUp = null, Action onInputDown = null, Action onInput = null) { var item = new InputKeyboardEvent() { keyCode = code, OnInputEvent = onInput, OnInputDownEvent = onInputDown, OnInputUpEvent = onInputUp, }; item.index = customFreeIndex++; inputHandlers.Add(item); return(item.index); }