Struct Vector2MagnitudeComparer
Compare two
Namespace: UnityEngine.InputSystem.Utilities
Syntax
public struct Vector2MagnitudeComparer : IComparer<Vector2>
Examples
private class CompositeWithVector2Part : InputBindingComposite<Vector2> { [InputControlAttribute(layout = "Vector2")] public int part;
public override Vector2 ReadValue(ref InputBindingCompositeContext context)
{
// Return the Vector3 with the greatest magnitude.
return context.ReadValue<Vector2, Vector2MagnitudeComparer>(part);
}
}
Methods
Compare(Vector2, Vector2)
Declaration
public int Compare(Vector2 x, Vector2 y)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | x | |
Vector2 | y |
Returns
Type | Description |
---|---|
System.Int32 |