Editar

Compartir a través de


VectorExtensions.Average Method

Definition

Overloads

Average(ICollection<Vector2>)

Given a collection of 2D vectors, calculate the averages for each vector component.

Average(ICollection<Vector3>)

Given a collection of 3D vectors, calculate the averages for each vector component.

Average(IEnumerable<Vector2>)

Given a collection of 2D vectors, calculate the averages for each vector component.

Average(IEnumerable<Vector3>)

Given a collection of 3D vectors, calculate the averages for each vector component.

Average(ICollection<Vector2>)

Given a collection of 2D vectors, calculate the averages for each vector component.

public:
[System::Runtime::CompilerServices::Extension]
 static UnityEngine::Vector2 Average(System::Collections::Generic::ICollection<UnityEngine::Vector2> ^ vectors);
public static UnityEngine.Vector2 Average (this System.Collections.Generic.ICollection<UnityEngine.Vector2> vectors);
static member Average : System.Collections.Generic.ICollection<UnityEngine.Vector2> -> UnityEngine.Vector2
<Extension()>
Public Function Average (vectors As ICollection(Of Vector2)) As Vector2

Parameters

vectors
ICollection<UnityEngine.Vector2>

The collection of 2D vectors used when calculating the component-wise average.

Returns

UnityEngine.Vector2

A 2D vector containing averages for all vector components.

Applies to

Average(ICollection<Vector3>)

Given a collection of 3D vectors, calculate the averages for each vector component.

public:
[System::Runtime::CompilerServices::Extension]
 static UnityEngine::Vector3 Average(System::Collections::Generic::ICollection<UnityEngine::Vector3> ^ vectors);
public static UnityEngine.Vector3 Average (this System.Collections.Generic.ICollection<UnityEngine.Vector3> vectors);
static member Average : System.Collections.Generic.ICollection<UnityEngine.Vector3> -> UnityEngine.Vector3
<Extension()>
Public Function Average (vectors As ICollection(Of Vector3)) As Vector3

Parameters

vectors
ICollection<UnityEngine.Vector3>

The collection of 3D vectors used when calculating the component-wise average.

Returns

UnityEngine.Vector3

A 3D vector containing averages for all vector components.

Applies to

Average(IEnumerable<Vector2>)

Given a collection of 2D vectors, calculate the averages for each vector component.

public:
[System::Runtime::CompilerServices::Extension]
 static UnityEngine::Vector2 Average(System::Collections::Generic::IEnumerable<UnityEngine::Vector2> ^ vectors);
public static UnityEngine.Vector2 Average (this System.Collections.Generic.IEnumerable<UnityEngine.Vector2> vectors);
static member Average : seq<UnityEngine.Vector2> -> UnityEngine.Vector2
<Extension()>
Public Function Average (vectors As IEnumerable(Of Vector2)) As Vector2

Parameters

vectors
IEnumerable<UnityEngine.Vector2>

The collection of 2D vectors used when calculating the component-wise average.

Returns

UnityEngine.Vector2

A 2D vector containing averages for all vector components.

Applies to

Average(IEnumerable<Vector3>)

Given a collection of 3D vectors, calculate the averages for each vector component.

public:
[System::Runtime::CompilerServices::Extension]
 static UnityEngine::Vector3 Average(System::Collections::Generic::IEnumerable<UnityEngine::Vector3> ^ vectors);
public static UnityEngine.Vector3 Average (this System.Collections.Generic.IEnumerable<UnityEngine.Vector3> vectors);
static member Average : seq<UnityEngine.Vector3> -> UnityEngine.Vector3
<Extension()>
Public Function Average (vectors As IEnumerable(Of Vector3)) As Vector3

Parameters

vectors
IEnumerable<UnityEngine.Vector3>

The collection of 3D vectors used when calculating the component-wise average.

Returns

UnityEngine.Vector3

A 3D vector containing averages for all vector components.

Applies to