docs.unity3d.com
    Show / Hide Table of Contents

    Struct Vector2MagnitudeComparer

    Compare two Vector2 by magnitude.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Namespace: UnityEngine.InputSystem.Utilities
    Syntax
    public struct Vector2MagnitudeComparer : IComparer<Vector2>
    Examples

    public class CompositeWithVector2Part : InputBindingComposite<Vector2> { [InputControl(layout = "Vector2")] public int part;

    public override Vector2 ReadValue(ref InputBindingCompositeContext context)
    {
        // Return the Vector3 with the greatest magnitude.
        return context.ReadValue&lt;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
    Int32
    Implements
    IComparer<T>.Compare(T, T)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023