docs.unity3d.com
Search Results for

    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.

    Implements
    IEquatable<OSVersion>
    IComparable<OSVersion>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.ARKit
    Assembly: Unity.XR.ARKit.dll
    Syntax
    public struct OSVersion : IEquatable<OSVersion>, IComparable<OSVersion>

    Constructors

    OSVersion(int, int, int)

    Constructs a new version number.

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

    The major version component.

    int minor

    The minor version component.

    int point

    The point version component.

    Properties

    major

    The major version component.

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

    minor

    The minor version component.

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

    point

    The point version component.

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

    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
    int

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

    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
    bool

    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
    bool

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

    GetHashCode()

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

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    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

    operator ==(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
    bool

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

    operator >(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
    bool

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

    operator >=(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
    bool

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

    operator !=(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
    bool

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

    operator <(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
    bool

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

    operator <=(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
    bool

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

    Implements

    IEquatable<T>
    IComparable<T>
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)