SubstanceImporter Manual     Reference     Scripting  
Scripting > Editor Classes > SubstanceImporter
SubstanceImporter Inherits from AssetImporter

Substance importer lets you access the imported Procedural Material instances.

Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.

Functions
GetPrototypeNames

Get a list of the names of the Procedural Material prototypes in the package.

GetMaterialCount

Get the number of Procedural Material instances.

GetMaterials

Get an array with the Procedural Material instances.

CloneMaterial

Clones an existing Procedural Material instance.

InstantiateMaterial

Instantiate a new Procedural Material instance from a prototype.

DestroyMaterial

Destroy an existing Procedural Material instance.

ResetMaterial

Resets the Procedural Material to its default values.

RenameMaterial

Rename an existing Procedural Material instance.

OnShaderModified

After modifying the shader of a Procedural Material, call this function to apply the changes to the importer.

GetMaterialOffset

Get the material offset, which is used for all the textures that are part of this Procedural Material.

SetMaterialOffset

Set the material offset, which is used for all the textures that are part of this Procedural Material.

GetMaterialScale

Get the material scale, which is used for all the textures that are part of this Procedural Material.

SetMaterialScale

Set the material scale, which is used for all the textures that are part of this Procedural Material.

GetLoadTimeGenerated

Checks if the Procedural Material will be generated at load time.

SetLoadTimeGenerated

Specifies if the Procedural Material will be generated at load time.

GetGenerateAllOutputs

Checks if the Procedural Material need to force generation of all its outputs.

SetGenerateAllOutputs

Specifies if the Procedural Material need to force generation of all its outputs.

GetAnimationUpdateRate

Get the Procedural Material animation update rate in millisecond.

SetAnimationUpdateRate

Set the Procedural Material animation update rate in millisecond.

GetTextureAlphaSource

Get the alpha source of the given texture in the Procedural Material.

SetTextureAlphaSource

Set the alpha source of the given texture in the Procedural Material.

Inherited members
Inherited Variables
assetPath

The path name of the asset for this importer (Read Only)

name

The name of the object.

hideFlags

Should the object be hidden, saved with the scene or modifiable by the user?

Inherited Functions
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the game object.

Inherited Class Functions
GetAtPath

Retrieves the asset importer for the asset at path.

operator bool

Does the object exist?

Instantiate

Clones the object original and returns the clone.

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. It is strongly recommended to use Destroy instead.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

FindObjectOfType

Returns the first active loaded object of Type type.

operator ==

Compares if two objects refer to the same

operator !=

Compares if two objects refer to a different object

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new scene.