C# Класс Spine.Unity.MeshGeneration.ArraysMeshGenerator

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
addNormals bool
addTangents bool
attachmentVertexBuffer float[]
meshColors32 UnityEngine.Color32[]
meshNormals UnityEngine.Vector3[]
meshTangents UnityEngine.Vector4[]
meshUVs UnityEngine.Vector2[]
meshVertices UnityEngine.Vector3[]
tempTanBuffer UnityEngine.Vector2[]

Открытые методы

Метод Описание
EnsureSize ( int targetVertexCount, Vector3 &vertices, Vector2 &uvs, Color32 &colors ) : bool

Ensures the sizes of the passed array references. If they are not the correct size, a new array will be assigned to the references.

EnsureTriangleBuffersSize ( ExposedList submeshBuffers, int targetSubmeshCount, Spine.Unity.MeshGeneration.SubmeshInstruction instructionItems ) : bool
FillTriangles ( int &triangleBuffer, Skeleton skeleton, int triangleCount, int firstVertex, int startSlot, int endSlot, bool isLastSubmesh ) : void

Fills a submesh triangle buffer array.

FillTrianglesQuads ( int &triangleBuffer, int &storedTriangleCount, int &storedFirstVertex, int instructionsFirstVertex, int instructionTriangleCount, bool isLastSubmesh ) : void
FillVerts ( Skeleton skeleton, int startSlot, int endSlot, float zSpacing, bool pmaColors, Vector3 verts, Vector2 uvs, Color32 colors, int &vertexIndex, float &tempVertBuffer, Vector3 &boundsMin, Vector3 &boundsMax, bool renderMeshes = true ) : void

Fills Unity vertex data buffers with verts from the Spine Skeleton.

SolveTangents2DBuffer ( Vector4 tangents, Vector2 tempTanBuffer, int vertexCount ) : void

Step 3 of solving tangents. Fills a Vector4[] tangents array according to values calculated in step 2.

SolveTangents2DEnsureSize ( Vector4 &tangentBuffer, Vector2 &tempTanBuffer, int vertexCount ) : void

Step 1 of solving tangents. Ensure you have buffers of the correct size.

SolveTangents2DTriangles ( Vector2 tempTanBuffer, int triangles, int triangleCount, Vector3 vertices, Vector2 uvs, int vertexCount ) : void

Step 2 of solving tangents. Fills (part of) a temporary tangent-solution buffer based on the vertices and uvs defined by a submesh's triangle buffer. Only needs to be called once for single-submesh meshes.

ToBounds ( Vector3 boundsMin, Vector3 boundsMax ) : Bounds

Creates a UnityEngine.Bounds struct from minimum and maximum value vectors.

TryAddNormalsTo ( Mesh mesh, int targetVertexCount ) : void

Описание методов

EnsureSize() публичный статический Метод

Ensures the sizes of the passed array references. If they are not the correct size, a new array will be assigned to the references.
public static EnsureSize ( int targetVertexCount, Vector3 &vertices, Vector2 &uvs, Color32 &colors ) : bool
targetVertexCount int
vertices UnityEngine.Vector3
uvs UnityEngine.Vector2
colors UnityEngine.Color32
Результат bool

EnsureTriangleBuffersSize() публичный статический Метод

public static EnsureTriangleBuffersSize ( ExposedList submeshBuffers, int targetSubmeshCount, Spine.Unity.MeshGeneration.SubmeshInstruction instructionItems ) : bool
submeshBuffers ExposedList
targetSubmeshCount int
instructionItems Spine.Unity.MeshGeneration.SubmeshInstruction
Результат bool

FillTriangles() публичный статический Метод

Fills a submesh triangle buffer array.
public static FillTriangles ( int &triangleBuffer, Skeleton skeleton, int triangleCount, int firstVertex, int startSlot, int endSlot, bool isLastSubmesh ) : void
triangleBuffer int The triangle buffer array to be filled. This reference will be replaced in case the triangle values don't fit.
skeleton Skeleton Spine.Skeleton source of draw order slots.
triangleCount int The target triangle count.
firstVertex int First vertex of this submesh.
startSlot int Start slot.
endSlot int End slot.
isLastSubmesh bool If set to true, the triangle buffer is allowed to be larger than needed.
Результат void

FillTrianglesQuads() публичный статический Метод

public static FillTrianglesQuads ( int &triangleBuffer, int &storedTriangleCount, int &storedFirstVertex, int instructionsFirstVertex, int instructionTriangleCount, bool isLastSubmesh ) : void
triangleBuffer int
storedTriangleCount int
storedFirstVertex int
instructionsFirstVertex int
instructionTriangleCount int
isLastSubmesh bool
Результат void

FillVerts() публичный статический Метод

Fills Unity vertex data buffers with verts from the Spine Skeleton.
public static FillVerts ( Skeleton skeleton, int startSlot, int endSlot, float zSpacing, bool pmaColors, Vector3 verts, Vector2 uvs, Color32 colors, int &vertexIndex, float &tempVertBuffer, Vector3 &boundsMin, Vector3 &boundsMax, bool renderMeshes = true ) : void
skeleton Skeleton Spine.Skeleton source of the drawOrder array
startSlot int Slot index of the first slot.
endSlot int The index bounding the slot list. [endSlot - 1] is the last slot to be added.
zSpacing float Spacing along the z-axis between attachments.
pmaColors bool If set to true, vertex colors will be premultiplied. This will also enable additive.
verts UnityEngine.Vector3 Vertex positions array.
uvs UnityEngine.Vector2 Vertex UV array.
colors UnityEngine.Color32 Vertex color array (Color32).
vertexIndex int A reference to the running vertex index. This is used when more than one submesh is to be added.
tempVertBuffer float A temporary vertex position buffer for attachment position values.
boundsMin UnityEngine.Vector3 Reference to the running calculated minimum bounds.
boundsMax UnityEngine.Vector3 Reference to the running calculated maximum bounds.
renderMeshes bool Include MeshAttachments. If false, it will ignore MeshAttachments.
Результат void

SolveTangents2DBuffer() публичный статический Метод

Step 3 of solving tangents. Fills a Vector4[] tangents array according to values calculated in step 2.
public static SolveTangents2DBuffer ( Vector4 tangents, Vector2 tempTanBuffer, int vertexCount ) : void
tangents UnityEngine.Vector4 A Vector4[] that will eventually be used to set Mesh.tangents
tempTanBuffer UnityEngine.Vector2 A temporary Vector3[] for calculating tangents.
vertexCount int Number of vertices that require tangents (or the size of the vertex array)
Результат void

SolveTangents2DEnsureSize() публичный статический Метод

Step 1 of solving tangents. Ensure you have buffers of the correct size.
public static SolveTangents2DEnsureSize ( Vector4 &tangentBuffer, Vector2 &tempTanBuffer, int vertexCount ) : void
tangentBuffer UnityEngine.Vector4 Eventual Vector4[] tangent buffer to assign to Mesh.tangents.
tempTanBuffer UnityEngine.Vector2 Temporary Vector2 buffer for calculating directions.
vertexCount int Number of vertices that require tangents (or the size of the vertex array)
Результат void

SolveTangents2DTriangles() публичный статический Метод

Step 2 of solving tangents. Fills (part of) a temporary tangent-solution buffer based on the vertices and uvs defined by a submesh's triangle buffer. Only needs to be called once for single-submesh meshes.
public static SolveTangents2DTriangles ( Vector2 tempTanBuffer, int triangles, int triangleCount, Vector3 vertices, Vector2 uvs, int vertexCount ) : void
tempTanBuffer UnityEngine.Vector2 A temporary Vector3[] for calculating tangents.
triangles int The mesh's current triangles buffer.
triangleCount int The number of triangle indexes in the triangle array to be used.
vertices UnityEngine.Vector3 The mesh's current vertex position buffer.
uvs UnityEngine.Vector2 The mesh's current uvs buffer.
vertexCount int Number of vertices that require tangents (or the size of the vertex array)
Результат void

ToBounds() публичный статический Метод

Creates a UnityEngine.Bounds struct from minimum and maximum value vectors.
public static ToBounds ( Vector3 boundsMin, Vector3 boundsMax ) : Bounds
boundsMin UnityEngine.Vector3
boundsMax UnityEngine.Vector3
Результат UnityEngine.Bounds

TryAddNormalsTo() публичный Метод

public TryAddNormalsTo ( Mesh mesh, int targetVertexCount ) : void
mesh UnityEngine.Mesh
targetVertexCount int
Результат void

Описание свойств

addNormals защищенное свойство

protected bool addNormals
Результат bool

addTangents защищенное свойство

protected bool addTangents
Результат bool

attachmentVertexBuffer защищенное свойство

protected float[] attachmentVertexBuffer
Результат float[]

meshColors32 защищенное свойство

protected Color32[],UnityEngine meshColors32
Результат UnityEngine.Color32[]

meshNormals защищенное свойство

protected Vector3[],UnityEngine meshNormals
Результат UnityEngine.Vector3[]

meshTangents защищенное свойство

protected Vector4[],UnityEngine meshTangents
Результат UnityEngine.Vector4[]

meshUVs защищенное свойство

protected Vector2[],UnityEngine meshUVs
Результат UnityEngine.Vector2[]

meshVertices защищенное свойство

protected Vector3[],UnityEngine meshVertices
Результат UnityEngine.Vector3[]

tempTanBuffer защищенное свойство

protected Vector2[],UnityEngine tempTanBuffer
Результат UnityEngine.Vector2[]