Photon Fusion 2.1.1

NetworkArrayExtensions Class Reference

Provides extension methods for the NetworkArray class. More...

Static Public Member Functions

static ref T GetRef< T > (this NetworkArray< T > array, int index)
 Returns a reference to the element at a specified position in the NetworkArray.
static int IndexOf< T > (this NetworkArray< T > array, T elem)
 Finds the index of the first occurrence of a specified element in the NetworkArray.

Detailed Description

Provides extension methods for the NetworkArray class.

Member Function Documentation

◆ GetRef< T >()

ref T GetRef< T > ( this NetworkArray< T > array,
int index )
static

Returns a reference to the element at a specified position in the NetworkArray.

Parameters
arrayThe NetworkArray to search.
indexThe zero-based index of the element to get a reference for.
Returns
A reference to the element at the specified position in the NetworkArray.
Type Constraints
T :unmanaged 

◆ IndexOf< T >()

int IndexOf< T > ( this NetworkArray< T > array,
T elem )
static

Finds the index of the first occurrence of a specified element in the NetworkArray.

Parameters
arrayThe NetworkArray to search.
elemThe element to locate in the NetworkArray.
Returns
The zero-based index of the first occurrence of elem within the entire NetworkArray, if found; otherwise, -1.
Type Constraints
T :unmanaged 
T :IEquatable<T>