docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct UnsafeHashSet<T>.ReadOnly

    A read-only alias for the value of a UnsafeHashSet. Does not have its own allocated storage.

    Namespace: Unity.Collections.LowLevel.Unsafe
    Assembly: Unity.Collections.dll
    Syntax
    public struct UnsafeHashSet<T>.ReadOnly

    Properties

    Capacity

    The number of key-value pairs that fit in the current allocation.

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

    The number of key-value pairs that fit in the current allocation.

    Count

    The current number of key-value pairs in this hash map.

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

    The current number of key-value pairs in this hash map.

    IsCreated

    Whether this hash map has been allocated (and not yet deallocated).

    Declaration
    public readonly bool IsCreated { get; }
    Property Value
    Type Description
    bool

    True if this hash map has been allocated (and not yet deallocated).

    IsEmpty

    Whether this hash set is empty.

    Declaration
    public readonly bool IsEmpty { get; }
    Property Value
    Type Description
    bool

    True if this hash set is empty or if the set has not been constructed.

    Methods

    Contains(T)

    Returns true if a particular value is present.

    Declaration
    public readonly bool Contains(T item)
    Parameters
    Type Name Description
    T item

    The item to look up.

    Returns
    Type Description
    bool

    True if the item was present.

    GetEnumerator()

    Returns an enumerator over the key-value pairs of this hash map.

    Declaration
    public readonly UnsafeHashSet<T>.Enumerator GetEnumerator()
    Returns
    Type Description
    UnsafeHashSet<T>.Enumerator

    An enumerator over the key-value pairs of this hash map.

    ToNativeArray(AllocatorHandle)

    Returns an array with a copy of this set's values (in no particular order).

    Declaration
    public readonly NativeArray<T> ToNativeArray(AllocatorManager.AllocatorHandle allocator)
    Parameters
    Type Name Description
    AllocatorManager.AllocatorHandle allocator

    The allocator to use.

    Returns
    Type Description
    NativeArray<T>

    An array with a copy of the set's values.

    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)