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