docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Operator operator !=

    operator !=(ArSession, ArSession)

    Tests for inequality. Same as the negation of Equals(ArSession).

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

    The ArSession to compare with rhs.

    ArSession rhs

    The ArSession to compare with lhs.

    Returns
    Type Description
    bool

    Returns false if lhs is equal to rhs using Equals(ArSession). Returns true otherwise.

    operator !=(ArSession?, ArSession?)

    Tests for inequality.

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

    The native object to compare with rhs.

    ArSession? rhs

    The native object to compare with lhs.

    Returns
    Type Description
    bool

    Returns false if any of these conditions are met: - lhs and rhs are both not null and their underlying pointers are equal. - lhs is null and rhs's underlying pointer is null. - rhs is null and lhs's underlying pointer is null. - Both lhs and rhs are null.

     Returns true otherwise.
    
    Remarks

    This inequality operator lets you to compare an ArSession with null to determine whether its underlying pointer is null. This allows for a more natural comparison with the native ARCore object:

    bool TestForNull(ArSession obj)
    {
        if (obj != null)
        {
            // obj.AsIntPtr() is not IntPtr.Zero
        }
    }
    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)