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 |
---|---|---|
Sprite |
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 |
---|---|---|
Sprite |
spriteShapeController | SpriteShapeController of the GameObject. |
Native |
indices | Indices of generated geometry. Initialize to max Array count and contains default data. |
Native |
positions | Position of vertices in generated geometry. Initialize to max Array count and contains default data. |
Native |
texCoords | Texture Coordinates of vertices in generated geometry. Initialize to max Array count and contains default data. |
Native |
tangents | Tangent of vertices in generated geometry. Initialize to max Array count and contains default data. |
Native |
segments | Submeshes in generated geometry. Initialize to max Array count and contains default data. |
Native |
colliderData | Points that define the path of Collider. |
Returns
Type | Description |
---|---|
Job |
JobHandle for the allocated Job to generate Geometry. |