docs.unity3d.com
    Show / Hide Table of Contents

    Struct OSVersion

    Represents a version number consisting of major, minor, and point components. Version numbers are often written as Major.Minor.Point.

    Inherited Members
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: UnityEngine.XR.ARKit
    Syntax
    public struct OSVersion : IEquatable<OSVersion>, IComparable<OSVersion>

    Constructors

    OSVersion(Int32, Int32, Int32)

    Constructs a new version number.

    Declaration
    public OSVersion(int major, int minor = 0, int point = 0)
    Parameters
    Type Name Description
    Int32 major

    The major version component.

    Int32 minor

    The minor version component.

    Int32 point

    The point version component.

    Properties

    major

    The major version component.

    Declaration
    public int major { readonly get; }
    Property Value
    Type Description
    Int32

    minor

    The minor version component.

    Declaration
    public int minor { readonly get; }
    Property Value
    Type Description
    Int32

    point

    The point version component.

    Declaration
    public int point { readonly get; }
    Property Value
    Type Description
    Int32

    Methods

    CompareTo(OSVersion)

    IComparable interface. This is useful for sorting routines.

    Declaration
    public int CompareTo(OSVersion version)
    Parameters
    Type Name Description
    OSVersion version

    The other version to compare to.

    Returns
    Type Description
    Int32

    -1 if this OSVersion is less than version, 0 if they are equal, or 1 if this is greater.

    Implements
    IComparable<T>.CompareTo(T)

    Equals(Object)

    Compares for equality.

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

    The object to compare against.

    Returns
    Type Description
    Boolean

    Returns false if obj is null or is not of type OSVersion. Otherwise, returns the same value as Equals(OSVersion).

    Overrides
    ValueType.Equals(Object)

    Equals(OSVersion)

    Compares for equality. The three version components are compared against other's.

    Declaration
    public bool Equals(OSVersion other)
    Parameters
    Type Name Description
    OSVersion other

    The OSVersion to compare for equality.

    Returns
    Type Description
    Boolean

    True if other has the same major, minor, and point values.

    Implements
    IEquatable<T>.Equals(T)

    GetHashCode()

    Generates a hash code suitable for use in a HashSet or Dictionary.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A hash code. The same OSVersion will produce the same hash code.

    Overrides
    ValueType.GetHashCode()

    Parse(String)

    Parses a string which contains a version number of the form X.Y.Z somewhere in the string. If multiple such substrings exists, the first is used. The parser stops when either 3 components have been identified, or when fewer than 3 components have been identified and the next character is not a period (".") or a digit (0-9). If version is null or the empty string, this method returns the version 0.0.0

    Declaration
    public static OSVersion Parse(string version)
    Parameters
    Type Name Description
    String version

    The string to parse.

    Returns
    Type Description
    OSVersion

    A new OSVersion representing version.

    ToString()

    Generates a string representation of the version.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A string in the form major.minor.point.

    Overrides
    ValueType.ToString()

    Operators

    Equality(OSVersion, OSVersion)

    Tests whether lhs is the same version as rhs. This is the same as Equals(OSVersion).

    Declaration
    public static bool operator ==(OSVersion lhs, OSVersion rhs)
    Parameters
    Type Name Description
    OSVersion lhs

    The left-hand side of the comparison.

    OSVersion rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    Boolean

    true if lhs is the same version as rhs; otherwise, false.

    GreaterThan(OSVersion, OSVersion)

    Tests whether lhs is a later version compared to rhs.

    Declaration
    public static bool operator>(OSVersion lhs, OSVersion rhs)
    Parameters
    Type Name Description
    OSVersion lhs

    The left-hand side of the comparison.

    OSVersion rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    Boolean

    true if lhs is a later version compared to rhs; otherwise, false.

    GreaterThanOrEqual(OSVersion, OSVersion)

    Tests whether lhs is the same or a later version compared to rhs.

    Declaration
    public static bool operator >=(OSVersion lhs, OSVersion rhs)
    Parameters
    Type Name Description
    OSVersion lhs

    The left-hand side of the comparison.

    OSVersion rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    Boolean

    true if lhs is the same or a later version compared to rhs; otherwise, false.

    Inequality(OSVersion, OSVersion)

    Tests whether lhs is a different version from rhs.

    Declaration
    public static bool operator !=(OSVersion lhs, OSVersion rhs)
    Parameters
    Type Name Description
    OSVersion lhs

    The left-hand side of the comparison.

    OSVersion rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    Boolean

    true if lhs is a different version from rhs; otherwise, false.

    LessThan(OSVersion, OSVersion)

    Tests whether lhs is an earlier version compared to rhs.

    Declaration
    public static bool operator <(OSVersion lhs, OSVersion rhs)
    Parameters
    Type Name Description
    OSVersion lhs

    The left-hand side of the comparison.

    OSVersion rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    Boolean

    true if lhs is an earlier version compared to rhs; otherwise, false.

    LessThanOrEqual(OSVersion, OSVersion)

    Tests whether lhs is the same or an earlier version compared to rhs.

    Declaration
    public static bool operator <=(OSVersion lhs, OSVersion rhs)
    Parameters
    Type Name Description
    OSVersion lhs

    The left-hand side of the comparison.

    OSVersion rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    Boolean

    true if lhs is the same or an earlier version compared to rhs; otherwise, false.

    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