Esempio n. 1
0
        private void Update()
        {
            if (InputProxy.GetKeyUp(KeyCode.Escape))
            {
                EscapePressed?.Invoke();
            }

            foreach (var pair in ModificationKeys)
            {
                if (InputProxy.GetKeyDown(pair.Key))
                {
                    keyboardInput.KeyDown(pair.Value);
                }

                if (InputProxy.GetKeyUp(pair.Key))
                {
                    keyboardInput.KeyUp(pair.Value);
                }
            }

            foreach (var pair in NumpadKeys)
            {
                if (InputProxy.GetKeyDown(pair.Key))
                {
                    keyboardInput.PressKey(pair.Value);
                }
            }

            AllKeyCodes.ForEach(code =>
            {
                if (InputProxy.GetKeyDown(code))
                {
                    var key = KeysConverter.Convert(code);
                    keyboardInput.PressKey(key);
                }
            });
        }