docs.unity3d.com
    Show / Hide Table of Contents

    Struct Math.FloatRange

    Range of possible values for some constrained parameter.

    Inherited Members
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.Physics
    Syntax
    public struct FloatRange : IEquatable<Math.FloatRange>

    Constructors

    FloatRange(Single, Single)

    Constructor.

    Declaration
    public FloatRange(float min, float max)
    Parameters
    Type Name Description
    Single min

    The minimum.

    Single max

    The maximum.

    Fields

    Max

    The maximum.

    Declaration
    public float Max
    Field Value
    Type Description
    Single

    Min

    The minimum.

    Declaration
    public float Min
    Field Value
    Type Description
    Single

    Properties

    Mid

    Gets the middle.

    Declaration
    public readonly float Mid { get; }
    Property Value
    Type Description
    Single

    The middle.

    Methods

    Equals(Object)

    Tests if this object is considered equal to another.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The object to compare to this object.

    Returns
    Type Description
    Boolean

    True if the objects are considered equal, false if they are not.

    Overrides
    ValueType.Equals(Object)

    Equals(Math.FloatRange)

    Tests if this FloatRange is considered equal to another.

    Declaration
    public bool Equals(Math.FloatRange other)
    Parameters
    Type Name Description
    Math.FloatRange other

    The float range to compare to this object.

    Returns
    Type Description
    Boolean

    True if the objects are considered equal, false if they are not.

    Implements
    IEquatable<T>.Equals(T)

    GetHashCode()

    Calculates a hash code for this object.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A hash code for this object.

    Overrides
    ValueType.GetHashCode()

    Sorted()

    Returns a sorted copy of this instance.

    Declaration
    public Math.FloatRange Sorted()
    Returns
    Type Description
    Math.FloatRange

    A copy of this instance, where Min is the lesser of Min and Max , and Max is the greater of the two.

    ToString()

    Convert this object into a string representation.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A string that represents this object.

    Overrides
    ValueType.ToString()

    Operators

    Implicit(float2 to Math.FloatRange)

    Implicit cast that converts the given float2 to a FloatRange.

    Declaration
    public static implicit operator Math.FloatRange(float2 f)
    Parameters
    Type Name Description
    float2 f

    A float2 to process.

    Returns
    Type Description
    Math.FloatRange

    The result of the operation.

    Implicit(Math.FloatRange to float2)

    Implicit cast that converts the given FloatRange to a float2.

    Declaration
    public static implicit operator float2(Math.FloatRange range)
    Parameters
    Type Name Description
    Math.FloatRange range

    The range.

    Returns
    Type Description
    float2

    The result of the operation.

    Back to top
    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