Exemplo n.º 1
0
    public void Record()
    {
        InputEvent inputEvent = new InputEvent(player);

        foreach (KeyCode keyCode in interestKeyCodes)
        {
            bool wasPressed = keyCodes [keyCode];
            bool isPressed  = Input.GetKey(keyCode);
            if (wasPressed != isPressed)
            {
                keyCodes[keyCode] = isPressed;
            }
            if (!wasPressed && isPressed)
            {
                inputEvent.AddKeyCode(keyCode);
            }
        }
        InputEventMulticaster.Instance.Multicast(inputEvent);
    }