Version: Unity 6.3 Beta (6000.3)
LanguageEnglish
  • C#

SVGImporter

class in Unity.VectorGraphics.Editor

/

Inherits from:AssetImporters.ScriptedImporter

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

The SVG importer class.

Properties

Property Description
AdvancedModeUse advanced settings.
AlignmentThe SVG sprite alignement.
CustomPivotThe custom pivot, when alignement is "Custom".
FilterModeThe filter mode of the texture (only used when importing to a texture).
GeneratePhysicsShapeAutomaticallly generates a physics shape.
GradientResolutionMaximum resolution for gradient texture.
KeepTextureAspectRatioThe size of the texture (only used when importing to a texture).
MaxCordDeviationDistance on the cord to a straight line between two points after which more tessellation will be generated.
MaxCordDeviationEnabledEnables the "max coord deviation" constraint.
MaxTangentAngleMax tangent angle (in degrees) after which more tessellation will be generated.
MaxTangentAngleEnabledEnables the "max tangent angle" constraint.
PredefinedResolutionIndexThe predefined resolution used, when not in advanced mode.
PreserveSVGImageAspectWhen importing to an SVGImage, preserves the aspect ratio of the generated sprite.
ResolutionMultiplierAn additional scale factor on the target resolution.
SampleCountThe number of samples per pixel (only used when importing to a texture).
SamplingStepDistanceNumber of samples evaluated on paths.
StepDistanceThe uniform step distance used for tessellation.
SvgPixelsPerUnitThe number of pixels per Unity units.
SvgTypeHow the SVG file will be imported
TargetResolutionThe target resolution on which this SVG is displayed.
TessellationMode The serialization mode used when importing the SVG document.
TexturedSpriteMeshTypeFor textured sprite, the mesh type
TextureHeightThe height of the texture (only used when importing to a texture).
TextureSizeThe size of the texture (only used when importing to a texture with "keep aspect ratio").
TextureWidthThe width of the texture (only used when importing to a texture).
UseSVGPixelsPerUnitWhen importing as a textured sprite asset, uses the SVG size to compute the pixels per unit.
ViewportOptionsViewport options to use when importing the SVG document.
WrapModeThe wrap mode of the texture (only used when importing to a texture).

Public Methods

Method Description
OnImportAssetImports an SVG asset

Inherited Members

Properties

PropertyDescription
assetBundleNameGet or set the AssetBundle name.
assetBundleVariantGet or set the AssetBundle variant.
assetPathThe path name of the asset for this importer. (Read Only)
importSettingsMissingThe value is true when no meta file is provided with the imported asset.
userDataGet or set any user data.
hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameThe name of the object.

Public Methods

MethodDescription
AddRemapMap a sub-asset from an imported asset (such as an FBX file) to an external Asset of the same type.
GetExternalObjectMapGets a copy of the external object map used by the AssetImporter.
RemoveRemapRemoves an item from the map of external objects.
SaveAndReimportSave asset importer settings if asset importer is dirty.
SetAssetBundleNameAndVariantSet the AssetBundle name and variant.
SupportsRemappedAssetTypeChecks if the AssetImporter supports remapping the given asset type.
GetInstanceIDGets the instance ID of the object.
ToStringReturns the name of the object.
SupportsRemappedAssetTypeOverride this method if your ScriptedImporter supports remapping specific asset types.

Static Methods

MethodDescription
GetAtPathRetrieves the asset importer for the asset at path.
GetImportLogRetrieves logs generated during the import of the asset at path.
DestroyRemoves a GameObject, component, or asset.
DestroyImmediateDestroys the specified object immediately. Use with caution and in Edit mode only.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindAnyObjectByTypeRetrieves any active loaded object of Type type.
FindFirstObjectByTypeRetrieves the first active loaded object of Type type.
FindObjectsByTypeRetrieves a list of all loaded objects of Type type.
InstantiateClones the object original and returns the clone.
InstantiateAsyncCaptures a snapshot of the original object (that must be related to some GameObject) and returns the AsyncInstantiateOperation.

Operators

OperatorDescription
boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.

Messages

MessageDescription
GatherDependenciesFromSourceFileA static callback that you can implement to set up artifact dependencies to other Assets, and optimize the order your assets are imported.
OnValidateThis function is called when the importer is loaded or a value is changed in the Inspector.
ResetReset to default values.