Class SpriteShapeGeometryCreator
Custom Post Processing after geometry is generated.
Inherited Members
Namespace: UnityEngine.U2D
Assembly: Unity.2D.SpriteShape.Runtime.dll
Syntax
public abstract class SpriteShapeGeometryCreator : ScriptableObject
Methods
GetVersion()
Get Versioning so we can check if geometry needs to be generated.
Declaration
public virtual int GetVersion()
Returns
| Type | Description |
|---|---|
| int | Version of Generator. |
GetVertexArrayCount(SpriteShapeController)
Get size of the vertices to be allocated for the Job. This is also used to determine the number of indices needed. Current implementaiton only allows 1 vertex to be mapped to 1 index thus the index array will have the same length as the vertex array.
Declaration
public abstract int GetVertexArrayCount(SpriteShapeController spriteShapeController)
Parameters
| Type | Name | Description |
|---|---|---|
| SpriteShapeController | spriteShapeController | SpriteShapeController of the GameObject. |
Returns
| Type | Description |
|---|---|
| int | Size of the VertexData to be allocated |
MakeCreatorJob(SpriteShapeController, NativeArray<ushort>, NativeSlice<Vector3>, NativeSlice<Vector2>, NativeSlice<Vector4>, NativeArray<SpriteShapeSegment>, NativeArray<float2>)
Create SpriteShape Geometry.
Declaration
public abstract JobHandle MakeCreatorJob(SpriteShapeController spriteShapeController, NativeArray<ushort> indices, NativeSlice<Vector3> positions, NativeSlice<Vector2> texCoords, NativeSlice<Vector4> tangents, NativeArray<SpriteShapeSegment> segments, NativeArray<float2> colliderData)
Parameters
| Type | Name | Description |
|---|---|---|
| SpriteShapeController | spriteShapeController | SpriteShapeController of the GameObject. |
| NativeArray<ushort> | indices | Indices of generated geometry. Initialize to max Array count and contains default data. |
| NativeSlice<Vector3> | positions | Position of vertices in generated geometry. Initialize to max Array count and contains default data. |
| NativeSlice<Vector2> | texCoords | Texture Coordinates of vertices in generated geometry. Initialize to max Array count and contains default data. |
| NativeSlice<Vector4> | tangents | Tangent of vertices in generated geometry. Initialize to max Array count and contains default data. |
| NativeArray<SpriteShapeSegment> | segments | Submeshes in generated geometry. Initialize to max Array count and contains default data. |
| NativeArray<float2> | colliderData | Points that define the path of Collider. |
Returns
| Type | Description |
|---|---|
| JobHandle | JobHandle for the allocated Job to generate Geometry. |