C# Class UnityEngine.Material

The material class.

Inheritance: UnityEngine.Object
Exibir arquivo Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Public Methods

Method Description
GetColor ( int nameID ) : Color

Get a named color value.

GetColor ( string propertyName ) : Color

Get a named color value.

GetColorArray ( int nameID ) : Color[]

Get a named color array.

GetColorArray ( string name ) : Color[]

Get a named color array.

GetColorArray ( int nameID, List values ) : void
GetColorArray ( string name, List values ) : void
GetFloat ( string propertyName ) : float

Get a named float value.

GetFloatArray ( int nameID ) : float[]

Get a named float array.

GetFloatArray ( string name ) : float[]

Get a named float array.

GetFloatArray ( int nameID, List values ) : void
GetFloatArray ( string name, List values ) : void
GetInt ( int nameID ) : int

Get a named integer value.

GetInt ( string propertyName ) : int

Get a named integer value.

GetMatrix ( int nameID ) : Matrix4x4

Get a named matrix value from the shader.

GetMatrix ( string propertyName ) : Matrix4x4

Get a named matrix value from the shader.

GetMatrixArray ( int nameID ) : UnityEngine.Matrix4x4[]

Get a named matrix array.

GetMatrixArray ( string name ) : UnityEngine.Matrix4x4[]

Get a named matrix array.

GetMatrixArray ( int nameID, List values ) : void
GetMatrixArray ( string name, List values ) : void
GetTexture ( string propertyName ) : Texture

Get a named texture.

GetTextureOffset ( string propertyName ) : Vector2

Gets the placement offset of texture propertyName.

GetTextureScale ( string propertyName ) : Vector2

Gets the placement scale of texture propertyName.

GetVector ( int nameID ) : Vector4

Get a named vector value.

GetVector ( string propertyName ) : Vector4

Get a named vector value.

GetVectorArray ( int nameID ) : Vector4[]

Get a named vector array.

GetVectorArray ( string name ) : Vector4[]

Get a named vector array.

GetVectorArray ( int nameID, List values ) : void
GetVectorArray ( string name, List values ) : void
HasProperty ( string propertyName ) : bool

Checks if material's shader has a property of a given name.

Material ( Material source ) : System

Create a temporary Material.

Material ( Shader shader ) : System

Create a temporary Material.

SetBuffer ( int nameID, ComputeBuffer value ) : void

Set a named ComputeBuffer value.

SetBuffer ( string name, ComputeBuffer value ) : void

Set a named ComputeBuffer value.

SetColor ( int nameID, Color color ) : void

Set a named color value.

SetColor ( string propertyName, Color color ) : void

Set a named color value.

SetColorArray ( int nameID, Color values ) : void

Set a color array property.

SetColorArray ( int nameID, List values ) : void
SetColorArray ( string name, Color values ) : void

Set a color array property.

SetColorArray ( string name, List values ) : void
SetFloat ( string propertyName, float value ) : void

Set a named float value.

SetFloatArray ( int nameID, List values ) : void
SetFloatArray ( int nameID, float values ) : void

Set a float array property.

SetFloatArray ( string name, List values ) : void
SetFloatArray ( string name, float values ) : void

Set a float array property.

SetInt ( int nameID, int value ) : void

Set a named integer value.

SetInt ( string propertyName, int value ) : void

Set a named integer value.

SetMatrix ( int nameID, Matrix4x4 matrix ) : void

Set a named matrix for the shader.

SetMatrix ( string propertyName, Matrix4x4 matrix ) : void

Set a named matrix for the shader.

SetMatrixArray ( int nameID, List values ) : void
SetMatrixArray ( int nameID, Matrix4x4 values ) : void

Set a matrix array property.

SetMatrixArray ( string name, List values ) : void
SetMatrixArray ( string name, Matrix4x4 values ) : void

Set a matrix array property.

SetTexture ( string propertyName, Texture texture ) : void

Set a named texture.

SetTextureOffset ( string propertyName, Vector2 offset ) : void

Sets the placement offset of texture propertyName.

SetTextureScale ( string propertyName, Vector2 scale ) : void

Sets the placement scale of texture propertyName.

SetVector ( int nameID, Vector4 vector ) : void

Set a named vector value.

SetVector ( string propertyName, Vector4 vector ) : void

Set a named vector value.

SetVectorArray ( int nameID, List values ) : void
SetVectorArray ( int nameID, Vector4 values ) : void

Set a vector array property.

SetVectorArray ( string name, List values ) : void
SetVectorArray ( string name, Vector4 values ) : void

Set a vector array property.

Private Methods

Method Description
CopyPropertiesFromMaterial ( Material mat ) : void
Create ( string scriptContents ) : Material
DisableKeyword ( string keyword ) : void
EnableKeyword ( string keyword ) : void
FindPass ( string passName ) : int
GetColorArrayImpl ( int nameID ) : Color[]
GetColorArrayImplList ( int nameID, object list ) : void
GetFloat ( int nameID ) : float
GetFloatArrayImpl ( int nameID ) : float[]
GetFloatArrayImplList ( int nameID, object list ) : void
GetMatrixArrayImpl ( int nameID ) : UnityEngine.Matrix4x4[]
GetMatrixArrayImplList ( int nameID, object list ) : void
GetPassName ( int pass ) : string
GetTag ( string tag, bool searchFallbacks ) : string
GetTag ( string tag, bool searchFallbacks, [ defaultValue ) : string
GetTexture ( int nameID ) : Texture
GetVectorArrayImpl ( int nameID ) : Vector4[]
GetVectorArrayImplList ( int nameID, object list ) : void
HasProperty ( int nameID ) : bool
INTERNAL_CALL_GetColor ( Material self, int nameID, Color &value ) : void
INTERNAL_CALL_GetMatrix ( Material self, int nameID, Matrix4x4 &value ) : void
INTERNAL_CALL_SetColor ( Material self, int nameID, Color &color ) : void
INTERNAL_CALL_SetMatrix ( Material self, int nameID, Matrix4x4 &matrix ) : void
INTERNAL_CALL_SetTextureOffset ( Material self, string propertyName, Vector2 &offset ) : void
INTERNAL_CALL_SetTextureScale ( Material self, string propertyName, Vector2 &scale ) : void
Internal_CreateWithMaterial ( [ mono, Material source ) : void
Internal_CreateWithShader ( [ mono, Shader shader ) : void
Internal_CreateWithString ( [ mono, string contents ) : void
Internal_GetTextureScaleAndOffset ( Material mat, string name, Vector4 &output ) : void
IsKeywordEnabled ( string keyword ) : bool
Lerp ( Material start, Material end, float t ) : void
Material ( string contents ) : System
SetBufferImpl ( int nameID, ComputeBuffer value ) : void
SetColorArrayImpl ( int nameID, Color values ) : void
SetColorArrayImplList ( int nameID, object values ) : void
SetFloat ( int nameID, float value ) : void
SetFloatArrayImpl ( int nameID, float values ) : void
SetFloatArrayImplList ( int nameID, object values ) : void
SetMatrixArrayImpl ( int nameID, Matrix4x4 values ) : void
SetMatrixArrayImplList ( int nameID, object values ) : void
SetOverrideTag ( string tag, string val ) : void
SetPass ( int pass ) : bool
SetTexture ( int nameID, Texture texture ) : void
SetVectorArrayImpl ( int nameID, Vector4 values ) : void
SetVectorArrayImplList ( int nameID, object values ) : void

Method Details

GetColor() public method

Get a named color value.

public GetColor ( int nameID ) : Color
nameID int The name ID of the property retrieved by Shader.PropertyToID.
return Color

GetColor() public method

Get a named color value.

public GetColor ( string propertyName ) : Color
propertyName string The name of the property.
return Color

GetColorArray() public method

Get a named color array.

public GetColorArray ( int nameID ) : Color[]
nameID int The name ID of the property retrieved by Shader.PropertyToID.
return Color[]

GetColorArray() public method

Get a named color array.

public GetColorArray ( string name ) : Color[]
name string The name of the property.
return Color[]

GetColorArray() public method

public GetColorArray ( int nameID, List values ) : void
nameID int
values List
return void

GetColorArray() public method

public GetColorArray ( string name, List values ) : void
name string
values List
return void

GetFloat() public method

Get a named float value.

public GetFloat ( string propertyName ) : float
propertyName string The name of the property.
return float

GetFloatArray() public method

Get a named float array.

public GetFloatArray ( int nameID ) : float[]
nameID int The name ID of the property retrieved by Shader.PropertyToID.
return float[]

GetFloatArray() public method

Get a named float array.

public GetFloatArray ( string name ) : float[]
name string The name of the property.
return float[]

GetFloatArray() public method

public GetFloatArray ( int nameID, List values ) : void
nameID int
values List
return void

GetFloatArray() public method

public GetFloatArray ( string name, List values ) : void
name string
values List
return void

GetInt() public method

Get a named integer value.

public GetInt ( int nameID ) : int
nameID int The name ID of the property retrieved by Shader.PropertyToID.
return int

GetInt() public method

Get a named integer value.

public GetInt ( string propertyName ) : int
propertyName string The name of the property.
return int

GetMatrix() public method

Get a named matrix value from the shader.

public GetMatrix ( int nameID ) : Matrix4x4
nameID int The name ID of the property retrieved by Shader.PropertyToID.
return Matrix4x4

GetMatrix() public method

Get a named matrix value from the shader.

public GetMatrix ( string propertyName ) : Matrix4x4
propertyName string The name of the property.
return Matrix4x4

GetMatrixArray() public method

Get a named matrix array.

public GetMatrixArray ( int nameID ) : UnityEngine.Matrix4x4[]
nameID int The name ID of the property retrieved by Shader.PropertyToID.
return UnityEngine.Matrix4x4[]

GetMatrixArray() public method

Get a named matrix array.

public GetMatrixArray ( string name ) : UnityEngine.Matrix4x4[]
name string The name of the property.
return UnityEngine.Matrix4x4[]

GetMatrixArray() public method

public GetMatrixArray ( int nameID, List values ) : void
nameID int
values List
return void

GetMatrixArray() public method

public GetMatrixArray ( string name, List values ) : void
name string
values List
return void

GetTexture() public method

Get a named texture.

public GetTexture ( string propertyName ) : Texture
propertyName string The name of the property.
return Texture

GetTextureOffset() public method

Gets the placement offset of texture propertyName.

public GetTextureOffset ( string propertyName ) : Vector2
propertyName string The name of the property.
return Vector2

GetTextureScale() public method

Gets the placement scale of texture propertyName.

public GetTextureScale ( string propertyName ) : Vector2
propertyName string The name of the property.
return Vector2

GetVector() public method

Get a named vector value.

public GetVector ( int nameID ) : Vector4
nameID int The name ID of the property retrieved by Shader.PropertyToID.
return Vector4

GetVector() public method

Get a named vector value.

public GetVector ( string propertyName ) : Vector4
propertyName string The name of the property.
return Vector4

GetVectorArray() public method

Get a named vector array.

public GetVectorArray ( int nameID ) : Vector4[]
nameID int The name ID of the property retrieved by Shader.PropertyToID.
return Vector4[]

GetVectorArray() public method

Get a named vector array.

public GetVectorArray ( string name ) : Vector4[]
name string The name of the property.
return Vector4[]

GetVectorArray() public method

public GetVectorArray ( int nameID, List values ) : void
nameID int
values List
return void

GetVectorArray() public method

public GetVectorArray ( string name, List values ) : void
name string
values List
return void

HasProperty() public method

Checks if material's shader has a property of a given name.

public HasProperty ( string propertyName ) : bool
propertyName string
return bool

Material() public method

Create a temporary Material.

public Material ( Material source ) : System
source Material Create a material by copying all properties from another material.
return System

Material() public method

Create a temporary Material.

public Material ( Shader shader ) : System
shader Shader Create a material with a given Shader.
return System

SetBuffer() public method

Set a named ComputeBuffer value.

public SetBuffer ( int nameID, ComputeBuffer value ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
value ComputeBuffer ComputeBuffer value to set.
return void

SetBuffer() public method

Set a named ComputeBuffer value.

public SetBuffer ( string name, ComputeBuffer value ) : void
name string Property name.
value ComputeBuffer ComputeBuffer value to set.
return void

SetColor() public method

Set a named color value.

public SetColor ( int nameID, Color color ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
color Color Color value to set.
return void

SetColor() public method

Set a named color value.

public SetColor ( string propertyName, Color color ) : void
propertyName string Property name, e.g. "_Color".
color Color Color value to set.
return void

SetColorArray() public method

Set a color array property.

public SetColorArray ( int nameID, Color values ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
values Color Array of values to set.
return void

SetColorArray() public method

public SetColorArray ( int nameID, List values ) : void
nameID int
values List
return void

SetColorArray() public method

Set a color array property.

public SetColorArray ( string name, Color values ) : void
name string Property name.
values Color Array of values to set.
return void

SetColorArray() public method

public SetColorArray ( string name, List values ) : void
name string
values List
return void

SetFloat() public method

Set a named float value.

public SetFloat ( string propertyName, float value ) : void
propertyName string Property name, e.g. "_Glossiness".
value float Float value to set.
return void

SetFloatArray() public method

public SetFloatArray ( int nameID, List values ) : void
nameID int
values List
return void

SetFloatArray() public method

Set a float array property.

public SetFloatArray ( int nameID, float values ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
values float Array of values to set.
return void

SetFloatArray() public method

public SetFloatArray ( string name, List values ) : void
name string
values List
return void

SetFloatArray() public method

Set a float array property.

public SetFloatArray ( string name, float values ) : void
name string Property name.
values float Array of values to set.
return void

SetInt() public method

Set a named integer value.

public SetInt ( int nameID, int value ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
value int Integer value to set.
return void

SetInt() public method

Set a named integer value.

public SetInt ( string propertyName, int value ) : void
propertyName string Property name, e.g. "_SrcBlend".
value int Integer value to set.
return void

SetMatrix() public method

Set a named matrix for the shader.

public SetMatrix ( int nameID, Matrix4x4 matrix ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
matrix Matrix4x4 Matrix value to set.
return void

SetMatrix() public method

Set a named matrix for the shader.

public SetMatrix ( string propertyName, Matrix4x4 matrix ) : void
propertyName string Property name, e.g. "_CubemapRotation".
matrix Matrix4x4 Matrix value to set.
return void

SetMatrixArray() public method

public SetMatrixArray ( int nameID, List values ) : void
nameID int
values List
return void

SetMatrixArray() public method

Set a matrix array property.

public SetMatrixArray ( int nameID, Matrix4x4 values ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
values Matrix4x4 Array of values to set.
return void

SetMatrixArray() public method

public SetMatrixArray ( string name, List values ) : void
name string
values List
return void

SetMatrixArray() public method

Set a matrix array property.

public SetMatrixArray ( string name, Matrix4x4 values ) : void
name string Property name.
values Matrix4x4 Array of values to set.
return void

SetTexture() public method

Set a named texture.

public SetTexture ( string propertyName, Texture texture ) : void
propertyName string Property name, e.g. "_MainTex".
texture Texture Texture to set.
return void

SetTextureOffset() public method

Sets the placement offset of texture propertyName.

public SetTextureOffset ( string propertyName, Vector2 offset ) : void
propertyName string
offset Vector2
return void

SetTextureScale() public method

Sets the placement scale of texture propertyName.

public SetTextureScale ( string propertyName, Vector2 scale ) : void
propertyName string
scale Vector2
return void

SetVector() public method

Set a named vector value.

public SetVector ( int nameID, Vector4 vector ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
vector Vector4 Vector value to set.
return void

SetVector() public method

Set a named vector value.

public SetVector ( string propertyName, Vector4 vector ) : void
propertyName string Property name, e.g. "_WaveAndDistance".
vector Vector4 Vector value to set.
return void

SetVectorArray() public method

public SetVectorArray ( int nameID, List values ) : void
nameID int
values List
return void

SetVectorArray() public method

Set a vector array property.

public SetVectorArray ( int nameID, Vector4 values ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
values Vector4 Array of values to set.
return void

SetVectorArray() public method

public SetVectorArray ( string name, List values ) : void
name string
values List
return void

SetVectorArray() public method

Set a vector array property.

public SetVectorArray ( string name, Vector4 values ) : void
name string Property name.
values Vector4 Array of values to set.
return void