The Input System provides a mechanism to register custom devices. For more details, please refer to the official documentation.
After registering a device using the method above, you can display the glyph images for that device by extending Input Glyphs. Extending requires handling C# scripts.
IInputGlyphLoader
. This class takes the device type and button information and returns a Texture2D
of the glyph image.
GamepadGlyphLoader.cs
InputGlyphManager
at the Awake()
timing.
GamepadGlyphInitializer.cs
The simplest method is to inherit from DeviceGlyphLoaderInitializer<T>
. This covers the loader processing, texture map passing, and manager registration. KeyboardGlyphInitializer.cs
and MouseGlyphInitializer.cs
are implemented in this way.
using InputGlyphs.Loaders.Utils;
public class MyDeviceGlyphInitializer : DeviceGlyphLoaderInitializer<MyDevice>
{
}
Attach this component to any object in the first scene and set the InputGlyphTextureMap
asset. For details on creating the InputGlyphTextureMap
asset, please refer to Glyph textures.