文档

Unity Engine

Unity Engine

GetPositions

Get the positions of all vertices in the trail.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

GetPositions(Vector3[])

Get the positions of all vertices in the trail.
public int GetPositions(Vector3[] positions)

Parameters

positions

The array of positions to retrieve.

Returns

Type

Description

intHow many positions were actually stored in the output array.

Remarks

This method is preferred to TrailRenderer.GetPosition when retrieving all positions, as it is more efficient to get all positions using a single command than to get each position individually.
Additional Resources: TrailRenderer.positionCount property.
Additional Resources: TrailRenderer.GetPosition function.

GetPositions(NativeArray<Vector3>)

Get the positions of all vertices in the trail.
public int GetPositions(NativeArray<Vector3> positions)

Parameters

The array of positions to retrieve.

Returns

Type

Description

intHow many positions were actually stored in the output array.

Remarks

This method is preferred to TrailRenderer.GetPosition when retrieving all positions, as it is more efficient to get all positions using a single command than to get each position individually.
Additional Resources: TrailRenderer.positionCount property.
Additional Resources: TrailRenderer.GetPosition function.

GetPositions(NativeSlice<Vector3>)

Get the positions of all vertices in the trail.
public int GetPositions(NativeSlice<Vector3> positions)

Parameters

The array of positions to retrieve.

Returns

Type

Description

intHow many positions were actually stored in the output array.

Remarks

This method is preferred to TrailRenderer.GetPosition when retrieving all positions, as it is more efficient to get all positions using a single command than to get each position individually.
Additional Resources: TrailRenderer.positionCount property.
Additional Resources: TrailRenderer.GetPosition function.