Struct NativeMeshData
Structure used by rendering jobs to facilitate mesh building in the Unity Job System on background threads.
Namespace: TycoonTerrain.Core.Rendering
Assembly: TycoonTerrainAssembly.dll
Syntax
public struct NativeMeshData
Constructors
NativeMeshData(Allocator)
Declaration
public NativeMeshData(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Unity. |
allocator |
NativeMeshData(NativeList<SubMeshTriangle>, NativeList<float3>, NativeList<float2>)
Declaration
public NativeMeshData(NativeList<SubMeshTriangle> indices, NativeList<float3> verts, NativeList<float2> uv)
Parameters
Type | Name | Description |
---|---|---|
Unity. |
indices | |
Unity. |
verts | |
Unity. |
uv |
Fields
indices
Declaration
public NativeList<SubMeshTriangle> indices
Field Value
Type | Description |
---|---|
Unity. |
uvs
Declaration
public NativeList<float2> uvs
Field Value
Type | Description |
---|---|
Unity. |
vertices
Declaration
public NativeList<float3> vertices
Field Value
Type | Description |
---|---|
Unity. |
Methods
CopyData(NativeMeshData, List<Vector3>, List<List<Int32>>, Dictionary<TileType, Int32>, List<Vector2>)
Copies the data from the native mesh data to managed data arrays.
Declaration
public static void CopyData(NativeMeshData from, List<Vector3> vertices, List<List<int>> indices, Dictionary<TileType, int> terrainTypeMapping, List<Vector2> uvs)
Parameters
Type | Name | Description |
---|---|---|
Native |
from | Native |
List<Unity |
vertices | The destination vertices. |
List<List<Int32>> | indices | The destination indices. |
Dictionary<Tile |
terrainTypeMapping | The tile type to submesh mappings. |
List<Vector2> | uvs | The destination uvs. |
CopyData(NativeMeshData, List<Vector3>, List<Int32>, List<Vector2>)
Copies the data from the native mesh data to managed data arrays.
Declaration
public static void CopyData(NativeMeshData from, List<Vector3> vertices, List<int> indices, List<Vector2> uvs)
Parameters
Type | Name | Description |
---|---|---|
Native |
from | Native |
List<Unity |
vertices | The destination vertices. |
List<Int32> | indices | The destination indices. |
List<Vector2> | uvs | The destination uvs. |
CopyIndices(NativeMeshData, List<List<Int32>>, Dictionary<TileType, Int32>)
Declaration
public static void CopyIndices(NativeMeshData from, List<List<int>> indices, Dictionary<TileType, int> mapping)
Parameters
Type | Name | Description |
---|---|---|
Native |
from | |
List<List<Int32>> | indices | |
Dictionary<Tile |
mapping |
CopyIndicesFlat(NativeMeshData, List<Int32>)
Ignores terrain type info and copies the indices to a flat array
Declaration
public static void CopyIndicesFlat(NativeMeshData from, List<int> indices)
Parameters
Type | Name | Description |
---|---|---|
Native |
from | The source native mesh data. |
List<Int32> | indices | The destination indices list. |
Dispose()
Declaration
public void Dispose()