Dynamic Array View on Asset Store (opens in new tab)

Package details

Latest version
2.0.1
Last updated
First released
Unity version
6000.0.29 or later
Package size
29 KB
Files
16
Favorites
6
Views in the past week
7

Price tracking

Last checked
Tracked since
Lowest recorded
Free on

Keywords

Dynamic Array

by santutu (opens in new tab)

No ratings yet

When using Physics.NonAlloc, you don't need to think about the array size.

Price Free

Get it free on Asset Store (opens in new tab)

Affiliate link · Purchases support this site

Price history

Last 6 months

USD
Price history for Dynamic Array, 6 months Current Free; lowest Free; highest Free in this period. $0 Jun Jul Aug Sep Oct Nov

Asset preview

1 / 3

Dynamic Array screenshot 1

Dynamic Array screenshot 1

About this asset

Background

1. Why should we pay attention to trivial matters? When using Physics.NonAlloc, determining the size of the array is usually unnecessary.

If the number of detected colliders exceeds the size of the array, the DynamicArray will automatically resize the array.

2. When executing Physics.NonAlloc method, the number of detected colliders and the actual colliders are handled separately as an int and an array[], making it inconvenient to use.

A DynamicArray instance holding this information would be more convenient to use.

3. For concise code.

using var result = DPhysics.OverlapSphereNonAllocFromPool(transform.position, 3);

foreach (var collider in result)

{

    Debug.Log(collider.name);

}

Use Case

1. automatic resizing

2. foreach loop

3. for loop

4. passing the detected collider array as a parameter

The detected colliders and their count can be accessed from anywhere using dynamicarray

5. from pool of dynamic array

6. shorthand

Readme.md

https://github.com/santutu/unity-dynamic-array/blob/main/README.md

Sample

https://github.com/santutu/unity-dynamic-array/blob/main/Assets/Santutu/Core/DynamicArray/Samples/Sample.cs

From the publisher's Asset Store listing.

Compatibility

Render pipelines supported in each Unity version
Unity version Built-in URP HDRP Custom
6000.0.29f1 Compatible Compatible Compatible Compatible

This package is not dependent on any render pipeline.

As listed on the Asset Store.