class in UnityEngine


Inherits from:Object

Switch to Manual


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.


colorThe main color of the Material.
doubleSidedGIGets and sets whether the Double Sided Global Illumination setting is enabled for this material.
enableInstancingGets and sets whether GPU instancing is enabled for this material.
globalIlluminationFlagsDefines how the material should interact with lightmaps and lightprobes.
mainTextureThe main texture.
mainTextureOffsetThe offset of the main texture.
mainTextureScaleThe scale of the main texture.
passCountHow many passes are in this material (Read Only).
renderQueueRender queue of this material.
shaderThe shader used by the material.
shaderKeywordsAdditional shader keywords set by this material.



Public Functions

ComputeCRCComputes a CRC hash value from the content of the material.
CopyPropertiesFromMaterialКопирует свойства с другого материала в данный материал.
DisableKeyword"Отзывает" ключевое слово шейдера.
EnableKeywordSets a shader keyword that is enabled by this material.
FindPassReturns the index of the pass passName.
GetColorПолучает имя значения цвета.
GetColorArrayGet a named color array.
GetFloatПолучает именованное float значение.
GetFloatArrayGet a named float array.
GetIntПолучает именованное integer значение.
GetMatrixПолучает именованное значение матрицы из шейдера.
GetMatrixArrayGet a named matrix array.
GetPassNameReturns the name of the shader pass at index pass.
GetShaderPassEnabledChecks whether a given Shader pass is enabled on this Material.
GetTagПолучает тэг шейдера материала.
GetTextureПолучает именованную текстуру.
GetTextureOffsetПолучает размещение смещения текстуры propertyName.
GetTexturePropertyNameIDsReturn the name IDs of all texture properties exposed on this material.
GetTexturePropertyNamesReturns the names of all texture properties exposed on this material.
GetTextureScaleПолучает размещение масштабирования текстуры propertyName.
GetVectorПолучает значение именованного вектора.
GetVectorArrayGet a named vector array.
HasPropertyПроверяет, имеет ли шейдер материала свойство по заданному имени.
IsKeywordEnabledУстанавливает ключевое слово шейдера, которое активируется данным материалом.
LerpИнтерполирует свойства между двумя материалами.
SetBufferSets a named ComputeBuffer value.
SetColorSets a named color value.
SetColorArraySets a color array property.
SetConstantBufferSets a ComputeBuffer as a named constant buffer for the material.
SetFloatSets a named float value.
SetFloatArraySets a float array property.
SetIntSets a named integer value.
SetMatrixSets a named matrix for the shader.
SetMatrixArraySets a matrix array property.
SetOverrideTagУстанавливает ключевое слово шейдера, которое активируется данным материалом.
SetPassАктивирует, учитывая pass для визуализации.
SetShaderPassEnabledEnables or disables a Shader pass on a per-Material level.
SetTextureSets a named texture.
SetTextureOffsetУстанавливает перемещение отступа текстуры propertyName.
SetTextureScaleУстанавливает перемещение масштабирования текстуры propertyName.
SetVectorSets a named vector value.
SetVectorArraySets a vector array property.

Inherited members


hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameThe name of the object.

Public Functions

GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the object.

Static Functions

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateClones the object original and returns the clone.


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.