Class SpriteShapeController
SpriteShapeController component contains Spline and SpriteShape Profile information that is used when generating SpriteShape geometry.
Inherited Members
Namespace: UnityEngine .U2D
Assembly: Unity.2D.SpriteShape.Runtime.dll
Syntax
[ExecuteInEditMode]
[RequireComponent(typeof(SpriteShapeRenderer))]
[DisallowMultipleComponent]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.spriteshape@latest/index.html?subfolder=/manual/SSController.html")]
public class SpriteShapeController : MonoBehaviour
Properties
angleRangeInfoArray
Angle Ranges
Declaration
public AngleRangeInfo[] angleRangeInfoArray { get; }
Property Value
Type | Description |
---|---|
Angle |
autoUpdateCollider
Auto update colliders on any change to SpriteShape geometry.
Declaration
public bool autoUpdateCollider { get; set; }
Property Value
Type | Description |
---|---|
bool |
boundsScale
Scale the Bounding Box of SpriteShape Geometry so its not culled out when scripting or dyanmically modifying Splines.
Declaration
public float boundsScale { get; set; }
Property Value
Type | Description |
---|---|
float |
colliderDetail
Level of detail for geometry generated for colliders.
Declaration
public int colliderDetail { get; set; }
Property Value
Type | Description |
---|---|
int |
colliderOffset
Offset for colliders.
Declaration
public float colliderOffset { get; set; }
Property Value
Type | Description |
---|---|
float |
cornerAngleThreshold
Angle threshold within which corners are enabled.
Declaration
public float cornerAngleThreshold { get; set; }
Property Value
Type | Description |
---|---|
float |
edgeCollider
EdgeCollider2D component attached to this Object.
Declaration
public EdgeCollider2D edgeCollider { get; }
Property Value
Type | Description |
---|---|
Edge |
enableTangents
Enable tangent channel when generating SpriteShape geometry (used in Shaders)
Declaration
public bool enableTangents { get; set; }
Property Value
Type | Description |
---|---|
bool |
fillPixelsPerUnit
Defines pixel per unit for fill geometry UV generation.
Declaration
public float fillPixelsPerUnit { get; set; }
Property Value
Type | Description |
---|---|
float |
hasCollider
Does this SpriteShapeController object has colliders ?
Declaration
public bool hasCollider { get; }
Property Value
Type | Description |
---|---|
bool |
modifiers
Get a list of Modifiers.
Declaration
public List<SpriteShapeGeometryModifier> modifiers { get; }
Property Value
Type | Description |
---|---|
List<Sprite |
optimizeCollider
Optimize generated collider geometry.
Declaration
public bool optimizeCollider { get; }
Property Value
Type | Description |
---|---|
bool |
optimizeGeometry
Optimize generated SpriteShape geometry.
Declaration
public bool optimizeGeometry { get; }
Property Value
Type | Description |
---|---|
bool |
polygonCollider
PolygonCollider2D component attached to this Object.
Declaration
public PolygonCollider2D polygonCollider { get; }
Property Value
Type | Description |
---|---|
Polygon |
spline
Spline object that has data to create the Bezier curve of this SpriteShape Controller.
Declaration
public Spline spline { get; }
Property Value
Type | Description |
---|---|
Spline |
splineDetail
Level of detail for generated geometry.
Declaration
public int splineDetail { get; set; }
Property Value
Type | Description |
---|---|
int |
spriteShape
SpriteShape Profile asset that contains information on how to generate/render SpriteShapes.
Declaration
public SpriteShape spriteShape { get; set; }
Property Value
Type | Description |
---|---|
Sprite |
spriteShapeCreator
Get/Set SpriteShape Geometry Creator.
Declaration
public SpriteShapeGeometryCreator spriteShapeCreator { get; set; }
Property Value
Type | Description |
---|---|
Sprite |
spriteShapeHashCode
Hash code for SpriteShape used to check for changes.
Declaration
public int spriteShapeHashCode { get; }
Property Value
Type | Description |
---|---|
int |
spriteShapeRenderer
SpriteShapeRenderer component of this Object.
Declaration
public SpriteShapeRenderer spriteShapeRenderer { get; }
Property Value
Type | Description |
---|---|
Sprite |
stretchTiling
Stretch tiling for inner fill geometry UV generation.
Declaration
public float stretchTiling { get; set; }
Property Value
Type | Description |
---|---|
float |
worldSpaceUVs
Defines whether UV for fill geometry uses local or global space.
Declaration
public bool worldSpaceUVs { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
BakeCollider()
Update Collider of this Object.
Declaration
public void BakeCollider()
BakeMesh()
Generate geometry on a Job.
Declaration
public JobHandle BakeMesh()
Returns
Type | Description |
---|---|
Job |
JobHandle for the SpriteShape geometry generation job. |
RefreshSpriteShape()
Refresh SpriteShape Hash so its force generated again on the next frame if its visible.
Declaration
public void RefreshSpriteShape()
UpdateSpriteShapeParameters()
Force update SpriteShape parameters.
Declaration
public bool UpdateSpriteShapeParameters()
Returns
Type | Description |
---|---|
bool | Returns true if there are changes |