Class SVGImporter
The SVG importer class.
Inheritance
Namespace: Unity.VectorGraphics.Editor
Syntax
public class SVGImporter : ScriptedImporter, ISpriteEditorDataProvider
Fields
AdvancedMode
Use advanced settings.
Declaration
public bool AdvancedMode
Field Value
Type | Description |
---|---|
System.Boolean |
Alignment
The SVG sprite alignement.
Declaration
public VectorUtils.Alignment Alignment
Field Value
Type | Description |
---|---|
VectorUtils.Alignment |
CustomPivot
The custom pivot, when alignement is "Custom".
Declaration
public Vector2 CustomPivot
Field Value
Type | Description |
---|---|
Vector2 |
GradientResolution
Maximum resolution for gradient texture.
Declaration
public UInt16 GradientResolution
Field Value
Type | Description |
---|---|
UInt16 |
MaxCordDeviation
Distance on the cord to a straight line between two points after which more tessellation will be generated.
Declaration
public float MaxCordDeviation
Field Value
Type | Description |
---|---|
System.Single |
MaxCordDeviationEnabled
Enables the "max coord deviation" constraint.
Declaration
public bool MaxCordDeviationEnabled
Field Value
Type | Description |
---|---|
System.Boolean |
MaxTangentAngle
Max tangent angle (in degrees) after which more tessellation will be generated.
Declaration
public float MaxTangentAngle
Field Value
Type | Description |
---|---|
System.Single |
MaxTangentAngleEnabled
Enables the "max tangent angle" constraint.
Declaration
public bool MaxTangentAngleEnabled
Field Value
Type | Description |
---|---|
System.Boolean |
PredefinedResolutionIndex
The predefined resolution used, when not in advanced mode.
Declaration
public int PredefinedResolutionIndex
Field Value
Type | Description |
---|---|
System.Int32 |
ResolutionMultiplier
An additional scale factor on the target resolution.
Declaration
public float ResolutionMultiplier
Field Value
Type | Description |
---|---|
System.Single |
SamplingStepDistance
Number of samples evaluated on paths.
Declaration
public float SamplingStepDistance
Field Value
Type | Description |
---|---|
System.Single |
StepDistance
The uniform step distance used for tessellation.
Declaration
public float StepDistance
Field Value
Type | Description |
---|---|
System.Single |
SvgPixelsPerUnit
The number of pixels per Unity units.
Declaration
public float SvgPixelsPerUnit
Field Value
Type | Description |
---|---|
System.Single |
TargetResolution
The target resolution on which this SVG is displayed.
Declaration
public int TargetResolution
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
pixelsPerUnit
Returns pixels per unit of the imported SVG
Declaration
public float pixelsPerUnit { get; }
Property Value
Type | Description |
---|---|
System.Single |
spriteImportMode
Returns the sprite import mode
Declaration
public SpriteImportMode spriteImportMode { get; }
Property Value
Type | Description |
---|---|
SpriteImportMode |
Remarks
For SVG files, the import mode is always "single"
targetObject
Returns imported sprite
Declaration
public UnityEngine.Object targetObject { get; }
Property Value
Type | Description |
---|---|
UnityEngine.Object |
Methods
OnImportAsset(AssetImportContext)
Imports an SVG asset
Declaration
public override void OnImportAsset(AssetImportContext ctx)
Parameters
Type | Name | Description |
---|---|---|
AssetImportContext | ctx | The asset import context of the scripted importer |