Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

InputManager

Sinai edited this page Jan 30, 2022 · 3 revisions

The InputManager class contains methods for using Unity's Input API regardless of which input package is being used by the game (Legacy or InputSystem).

It supports the common input API features such as MousePosition, MouseScrollDelta, GetKey/Down, GetMouseButton/Down, etc.

InputManager requires the startupDelay from Universe.Init to have finished, so any calls to its methods before then will return default.

KeyCode/Key

All key-related InputManager methods take a UnityEngine.KeyCode as opposed to a UnityEngine.InputSystem.Key, since KeyCode is always included in all builds of Unity, whereas Key is only present in games which use the InputSystem package.

If the game in fact uses InputSytem, UniverseLib will translate the KeyCode into the corresponding Key to the best of its ability. If you find a Key which is unsupported, please create an issue in this repository.

Clone this wiki locally