using UnityEngine.Scripting; namespace UnityEngine.InputSystem.Processors { /// /// Scale the components of a by constant factors. /// /// /// This processor is registered (see ) under the name "scaleVector3". /// /// /// /// // Double the magnitude of gravity values read from a gravity sensor. /// myAction.AddBinding("<GravitySensor>/gravity").WithProcessor("scaleVector3(x=2,y=2,z=2)"); /// /// /// /// /// public class ScaleVector3Processor : InputProcessor { /// /// Scale factor to apply to the vector's x axis. Defaults to 1. /// [Tooltip("Scale factor to multiply the incoming Vector3's X component by.")] public float x = 1; /// /// Scale factor to apply to the vector's y axis. Defaults to 1. /// [Tooltip("Scale factor to multiply the incoming Vector3's Y component by.")] public float y = 1; /// /// Scale factor to apply to the vector's z axis. Defaults to 1. /// [Tooltip("Scale factor to multiply the incoming Vector3's Z component by.")] public float z = 1; /// /// Return scaled by , , and . /// /// Input value. /// Ignored. /// Scaled vector. public override Vector3 Process(Vector3 value, InputControl control) { return new Vector3(value.x * x, value.y * y, value.z * z); } /// public override string ToString() { return $"ScaleVector3(x={x},y={y},z={z})"; } } }