Doloro GDK 22 .1.0 Beta
by Tauri Interactive
Doloro Input Tools

About

Warning
Aplha stage module. Not implements planned features yet.
Integrated to take a place in global modules architecture map. Will be extended along with future updates.

Doloro Input Tool is a module that helps to handle input operation and reactions on them.
The purpose of module is to make player experience much immersive no matter what device the player using.


Input Device Detector

The tool that receives input signal and define what a source device used to input. It works as a stand-alone component. To get access over it you enough to call it via InputDeviceDetector.Active.

You also may create one via Add Component menu at Inspector. The related option located by following path:
Doloro GDK / Tools / Input / Device detector

See also: Doloro.Tools.InputService.InputDeviceDetector


How to use

You have 2 ways to interact with the manager: manually or via callbacks.

Manual check

using Doloro.Tools.InputService
var device = InputDeviceDetector.Active.Current;
switch(device)
{
case Device.Mouse:
case Device.Keyboard:
// Handling PC-like input.
break;
case Device.Controller:
// Handling console-like input.
break;
}

Callback

using Doloro.Tools.Input
void Awake()
{
// Subscribing on input manager event.
InputDeviceDetector.onDeviceChanged += OnDeviceChanged;
}
void OnDestroy()
{
// Releasing event handler.
InputDeviceDetector.onDeviceChanged -= OnDeviceChanged;
}
private void OnDeviceChanged(InputDeviceDetector manager)
{
// Implement your reaction over device change.
}