Version: 5.3

Material

class in UnityEngine

/

다음으로부터 상속:Object

매뉴얼로 전환

설명

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 material's color.
globalIlluminationFlagsDefines how the material should interact with lightmaps and lightprobes.
mainTextureThe material's texture.
mainTextureOffsetThe texture offset of the main texture.
mainTextureScaleThe texture 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.

생성자

Material

Public 함수

CopyPropertiesFromMaterialCopy properties from other material into this material.
DisableKeywordUnset a shader keyword.
EnableKeywordSet a shader keyword that is enabled by this material.
GetColorGet a named color value.
GetFloatGet a named float value.
GetIntGet a named integer value.
GetMatrixGet a named matrix value from the shader.
GetTagGet the value of material's shader tag.
GetTextureGet a named texture.
GetTextureOffsetGets the placement offset of texture propertyName.
GetTextureScaleGets the placement scale of texture propertyName.
GetVectorGet a named vector value.
HasPropertyChecks if material's shader has a property of a given name.
IsKeywordEnabledIs the shader keyword enabled on this material?
LerpInterpolate properties between two materials.
SetBufferSet a ComputeBuffer value.
SetColorSet a named color value.
SetFloatSet a named float value.
SetIntSet a named integer value.When setting values on materials using the Standard Shader, you should be aware that you may need to use EnableKeyword to enable features of the shader that were not previously in use. For more detail, read Accessing Materials via Script.
SetMatrixSet a named matrix for the shader.
SetOverrideTagSets an override tag/value on the material.
SetPassActivate the given pass for rendering.
SetTextureSet a named texture.
SetTextureOffsetSets the placement offset of texture propertyName.
SetTextureScaleSets the placement scale of texture propertyName.
SetVectorSet a named vector value.

상속된 멤버

변수

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

Public 함수

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

정적 함수

DestroyRemoves a gameobject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadMakes the object target not be destroyed automatically 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.
InstantiateReturns a copy of the object original.

연산자

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.