docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Resize

    Resize(int, ResizeOptions)

    Reallocates the underlying buffer if necessary, depending on the given options.

    Declaration
    public void Resize(int newCount, ResizeOptions options = ResizeOptions.KeepExcessCapacity)
    Parameters
    Type Name Description
    int newCount

    The new value for Count. Can be 0.

    ResizeOptions options

    The resizing options. The default value is KeepExcessCapacity.

    Remarks

    When reallocation occurs, data is not copied over from the previous buffer. After a call to Resize, Count is always equal to the given newCount and Capacity is never smaller than Count. There is no growth factor to the resizing. Resize(0) will keep the current Capacity, while Resize(0, ResizeOptions.TrimExcessCapacity) will deallocate the underlying buffer.

    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)