/// <summary> /// Input.GetKeyDown() /// </summary> /// <param name="eventHandler"></param> public void InputEventHandlerRegister_GetKeyDown(KeyCode keyCode, DInputManagerGetKeyDown eventHandler) { if (eventHandler == null) { return; } if (EventDict_GetKeyDown == null) { return; } if (FlagDict_IsKeyDown != null && !FlagDict_IsKeyDown.ContainsKey(keyCode)) { lock (FlagDict_IsKeyDown) FlagDict_IsKeyDown.Add(keyCode, false); } if (!EventDict_GetKeyDown.ContainsKey(keyCode)) { lock (EventDict_GetKeyDown) EventDict_GetKeyDown.Add(keyCode, eventHandler); } else { lock (EventDict_GetKeyDown) EventDict_GetKeyDown[keyCode] += eventHandler; } }
public void InputEventHandlerUnRegister_GetKeyDown(KeyCode keyCode, DInputManagerGetKeyDown eventHandler) { if (eventHandler == null || EventDict_GetKeyDown == null || EventDict_GetKeyDown.Count <= 0 || !EventDict_GetKeyDown.ContainsKey(keyCode)) { return; } EventDict_GetKeyDown[keyCode] -= eventHandler; }