Skip to content

Game.Input.CameraZoomProcessor

Assembly: Assembly-CSharp.dll
Namespace: Game.Input

Type: class

Base: PlatformProcessor

Summary: Processes raw camera zoom input by applying a local scale (m_Scale) and then multiplying by the per-device zoom sensitivity defined in the game's shared input settings (SharedSettings.instance.input). The processor respects the PlatformProcessor base flags (e.g., needProcess) and uses the base-provided device type (m_DeviceType) to choose the appropriate sensitivity (mouse, keyboard, or gamepad). This is intended for use with Unity's Input System pipeline or called directly by code that routes raw zoom input values.


Fields

  • public float m_Scale This multiplier is applied to the incoming raw value before device-specific sensitivity is applied. Defaults to 1f. Increase to amplify zoom input, decrease to reduce it.

Properties

  • This type does not declare any additional properties.
    (It relies on members from its base class PlatformProcessor, such as needProcess and m_DeviceType.)

Constructors

  • public CameraZoomProcessor()
    Implicit default constructor. m_Scale is initialized to 1f; any base-class initialization is handled by PlatformProcessor.

Methods

  • public override float Process(float value, InputControl control)
    Processes a single zoom input sample:
  • If base.needProcess is false, the method returns the input value unchanged.
  • Retrieves the shared input settings via SharedSettings.instance.input (type: Game.Settings.InputSettings).
  • Multiplies the incoming value by m_Scale.
  • Multiplies that result by the sensitivity for the current device type (m_DeviceType) using:
    • input.mouseZoomSensitivity for ProcessorDeviceType.Mouse
    • input.keyboardZoomSensitivity for ProcessorDeviceType.Keyboard
    • input.gamepadZoomSensitivity for ProcessorDeviceType.Gamepad
    • 1f for any other device type
  • Returns the final scaled value.

Notes: - The method depends on PlatformProcessor for the needProcess flag and the m_DeviceType value. - InputControl parameter is unused in the current implementation but is part of the Input System processor signature.

Usage Example

// Example usage in code (outside the Unity Input System automatic pipeline):
var zoomProcessor = new Game.Input.CameraZoomProcessor
{
    m_Scale = 1.2f  // custom local scaling
};

float rawZoomInput = 0.5f; // example raw input value from some source
// 'control' is typically provided by the Input System; can be null if not needed here.
UnityEngine.InputSystem.InputControl control = null;

float processed = zoomProcessor.Process(rawZoomInput, control);

// 'processed' now reflects m_Scale multiplied by the per-device sensitivity
// from SharedSettings.instance.input (e.g., mouseZoomSensitivity).

Additional info: - Dependencies: Game.Settings.SharedSettings, Game.Settings.InputSettings, ProcessorDeviceType enum, PlatformProcessor, UnityEngine.InputSystem.InputControl. - The processor is lightweight and intended to be used as part of the input processing pipeline that normalizes user-configurable sensitivities per device.