Game.Input.ScrollSensitivityProcessor
Assembly:
Namespace: Game.Input
Type: class
Base: UnityEngine.InputSystem.InputProcessor
Summary: A lightweight input processor that scales raw scroll (float) input by the game's configured final scroll sensitivity. The processor multiplies the incoming float value by SharedSettings.instance.input.finalScrollSensitivity before returning it. Intended to be used with Unity's Input System to apply the game's scroll sensitivity consistently.
Fields
- (none) This class does not declare any instance or static fields. It is a stateless processor that reads the runtime SharedSettings singleton when processing input.
Properties
- (none) There are no public or private properties on this type.
Constructors
public ScrollSensitivityProcessor()
The class has the default parameterless constructor (implicit). No initialization is required.
Methods
public override float Process(float value, InputControl control)
Processes a raw scroll input value by multiplying it with SharedSettings.instance.input.finalScrollSensitivity and returning the result.
Notes:
- Depends on SharedSettings.instance and its input.finalScrollSensitivity property. If SharedSettings.instance is null (unlikely in normal game runtime), this will throw a NullReferenceException.
- The InputControl parameter is accepted to match the InputProcessor
Usage Example
// Direct usage: apply the processor manually
var processor = new Game.Input.ScrollSensitivityProcessor();
float rawScroll = 1.0f; // example raw input from device
float adjusted = processor.Process(rawScroll, null);
// Typical intent: register or reference this processor via Unity's Input System so it is applied automatically
// Example (if registration is needed at runtime):
// UnityEngine.InputSystem.InputSystem.RegisterProcessor<Game.Input.ScrollSensitivityProcessor>();
// If used as a processor on bindings, the Input System will call Process(...) for you and this processor
// will scale the scroll value by SharedSettings.instance.input.finalScrollSensitivity.