The material class.
This class exposes all properties from a material, allowing you to animate them.
You can also use it to set custom shader properties that can't be accessed through
the inspector (e.g. matrices).
In order to get the material used by an object, use the Renderer.material property.
See Also: Materials, Shaders.
color | The main material's color. |
globalIlluminationFlags | Defines how the material should interact with lightmaps and lightprobes. |
mainTexture | The material's texture. |
mainTextureOffset | The texture offset of the main texture. |
mainTextureScale | The texture scale of the main texture. |
passCount | How many passes are in this material (Read Only). |
renderQueue | Render queue of this material. |
shader | The shader used by the material. |
shaderKeywords | Additional shader keywords set by this material. |
Material |
CopyPropertiesFromMaterial | Copy properties from other material into this material. |
DisableKeyword | Unset a shader keyword. |
EnableKeyword | Set a shader keyword that is enabled by this material. |
FindPass | Returns the index of the pass passName. |
GetColor | Get a named color value. |
GetColorArray | Get a named color array. |
GetFloat | Get a named float value. |
GetFloatArray | Get a named float array. |
GetInt | Get a named integer value. |
GetMatrix | Get a named matrix value from the shader. |
GetMatrixArray | Get a named matrix array. |
GetPassName | Returns the name of the shader pass at index pass. |
GetTag | Get the value of material's shader tag. |
GetTexture | Get a named texture. |
GetTextureOffset | Gets the placement offset of texture propertyName. |
GetTextureScale | Gets the placement scale of texture propertyName. |
GetVector | Get a named vector value. |
GetVectorArray | Get a named vector array. |
HasProperty | Checks if material's shader has a property of a given name. |
IsKeywordEnabled | Is the shader keyword enabled on this material? |
Lerp | Interpolate properties between two materials. |
SetBuffer | Set a named ComputeBuffer value. |
SetColor | Set a named color value. |
SetColorArray | Set a color array property. |
SetFloat | Set a named float value. |
SetFloatArray | Set a float array property. |
SetInt | Set a named integer value. |
SetMatrix | Set a named matrix for the shader. |
SetMatrixArray | Set a matrix array property. |
SetOverrideTag | Sets an override tag/value on the material. |
SetPass | Activate the given pass for rendering. |
SetTexture | Set a named texture. |
SetTextureOffset | Sets the placement offset of texture propertyName. |
SetTextureScale | Sets the placement scale of texture propertyName. |
SetVector | Set a named vector value. |
SetVectorArray | Set a vector array property. |
hideFlags | Should the object be hidden, saved with the scene or modifiable by the user? |
name | The name of the object. |
GetInstanceID | Returns the instance id of the object. |
ToString | Returns the name of the game object. |
Destroy | Removes a gameobject, component or asset. |
DestroyImmediate | Destroys the object obj immediately. |
DontDestroyOnLoad | Makes the object target not be destroyed automatically when loading a new scene. |
FindObjectOfType | Returns the first active loaded object of Type type. |
FindObjectsOfType | Returns a list of all active loaded objects of Type type. |
Instantiate | Clones the object original and returns the clone. |
bool | Does 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. |