docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Constructor TrackableChanges

    TrackableChanges(int, int, int, Allocator)

    Constructs a TrackableChanges<T> from the number of added, updated, and removed trackables. This creates the NativeArrays added, updated, and removed and should be disposed by calling Dispose() on this object.

    Declaration
    public TrackableChanges(int addedCount, int updatedCount, int removedCount, Allocator allocator)
    Parameters
    Type Name Description
    int addedCount

    The number of added trackables.

    int updatedCount

    The number of updated trackables.

    int removedCount

    The number of removed trackables.

    Allocator allocator

    An allocator to use for each of added, updated, and removed arrays.

    TrackableChanges(int, int, int, Allocator, T)

    Constructor which creates all three arrays and fills the added and updated arrays with repeated copies of defaultValue.

    Declaration
    public TrackableChanges(int addedCount, int updatedCount, int removedCount, Allocator allocator, T defaultValue)
    Parameters
    Type Name Description
    int addedCount

    The number of added trackables.

    int updatedCount

    The number of updated trackables.

    int removedCount

    The number of removed trackables.

    Allocator allocator

    The allocator to use for each of added, updated, and removed arrays.

    T defaultValue

    The value with which to fill the added and updated arrays.

    TrackableChanges(void*, int, void*, int, void*, int, T, int, Allocator)

    Constructs a TrackableChanges<T> from native memory.

    Declaration
    public TrackableChanges(void* addedPtr, int addedCount, void* updatedPtr, int updatedCount, void* removedPtr, int removedCount, T defaultT, int stride, Allocator allocator)
    Parameters
    Type Name Description
    void* addedPtr

    A pointer to a block of memory containing addedCount elements each of size stride.

    int addedCount

    The number of added elements.

    void* updatedPtr

    A pointer to a block of memory containing updatedCount elements each of size stride.

    int updatedCount

    The number of updated elements.

    void* removedPtr

    A pointer to a block of memory containing removedCount TrackableIds.

    int removedCount

    The number of removed elements.

    T defaultT

    A default T which should be used to fill the added and updated arrays before copying data from addedPtr and updatedPtr, respectively.

    int stride

    The number of bytes for each element in the addedPtr and updatedPtr arrays.

    Allocator allocator

    An allocator to use when creating the added, updated, and removed arrays.

    Remarks

    Because native code might be using an older version of T, this constructor first fills the added and updated arrays with copies of defaultT before copying the data from the addedPtr and updatedPtr pointers. This ensures that the addition of new fields to T will have appropriate default values.

    In This Article
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Friday, September 22, 2023