Class Material
Assembly: UnityEngine.dll
Syntax
public class Material : Object
Constructors
|
Improve this Doc
View Source
Material(Material)
Declaration
public Material(Material source)
Parameters
|
Improve this Doc
View Source
Material(Shader)
Declaration
public Material(Shader shader)
Parameters
Type |
Name |
Description |
Shader |
shader |
|
Properties
|
Improve this Doc
View Source
color
Declaration
public Color color { get; set; }
Property Value
doubleSidedGI
Declaration
public bool doubleSidedGI { get; set; }
Property Value
enableInstancing
Declaration
public bool enableInstancing { get; set; }
Property Value
globalIlluminationFlags
Declaration
public MaterialGlobalIlluminationFlags globalIlluminationFlags { get; set; }
Property Value
|
Improve this Doc
View Source
mainTexture
Declaration
public Texture mainTexture { get; set; }
Property Value
|
Improve this Doc
View Source
mainTextureOffset
Declaration
public Vector2 mainTextureOffset { get; set; }
Property Value
|
Improve this Doc
View Source
mainTextureScale
Declaration
public Vector2 mainTextureScale { get; set; }
Property Value
passCount
Declaration
public int passCount { get; }
Property Value
renderQueue
Declaration
public int renderQueue { get; set; }
Property Value
shader
Declaration
public Shader shader { get; set; }
Property Value
|
Improve this Doc
View Source
shaderKeywords
Declaration
public string[] shaderKeywords { get; set; }
Property Value
Methods
CopyPropertiesFromMaterial(Material)
Declaration
public void CopyPropertiesFromMaterial(Material mat)
Parameters
|
Improve this Doc
View Source
Create(String)
Declaration
[Obsolete("Creating materials from shader source string will be removed in the future. Use Shader assets instead.", false)]
public static Material Create(string scriptContents)
Parameters
Type |
Name |
Description |
String |
scriptContents |
|
Returns
DisableKeyword(String)
Declaration
public void DisableKeyword(string keyword)
Parameters
Type |
Name |
Description |
String |
keyword |
|
EnableKeyword(String)
Declaration
public void EnableKeyword(string keyword)
Parameters
Type |
Name |
Description |
String |
keyword |
|
FindPass(String)
Declaration
public int FindPass(string passName)
Parameters
Type |
Name |
Description |
String |
passName |
|
Returns
|
Improve this Doc
View Source
GetColor(Int32)
Declaration
public Color GetColor(int nameID)
Parameters
Type |
Name |
Description |
Int32 |
nameID |
|
Returns
|
Improve this Doc
View Source
GetColor(String)
Declaration
public Color GetColor(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
|
Improve this Doc
View Source
GetColorArray(Int32)
Declaration
public Color[] GetColorArray(int nameID)
Parameters
Type |
Name |
Description |
Int32 |
nameID |
|
Returns
|
Improve this Doc
View Source
GetColorArray(Int32, List<Color>)
Declaration
public void GetColorArray(int nameID, List<Color> values)
Parameters
|
Improve this Doc
View Source
GetColorArray(String)
Declaration
public Color[] GetColorArray(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
|
Improve this Doc
View Source
GetColorArray(String, List<Color>)
Declaration
public void GetColorArray(string name, List<Color> values)
Parameters
|
Improve this Doc
View Source
GetFloat(Int32)
Declaration
public float GetFloat(int nameID)
Parameters
Type |
Name |
Description |
Int32 |
nameID |
|
Returns
|
Improve this Doc
View Source
GetFloat(String)
Declaration
public float GetFloat(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
|
Improve this Doc
View Source
GetFloatArray(Int32)
Declaration
public float[] GetFloatArray(int nameID)
Parameters
Type |
Name |
Description |
Int32 |
nameID |
|
Returns
|
Improve this Doc
View Source
GetFloatArray(Int32, List<Single>)
Declaration
public void GetFloatArray(int nameID, List<float> values)
Parameters
|
Improve this Doc
View Source
GetFloatArray(String)
Declaration
public float[] GetFloatArray(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
|
Improve this Doc
View Source
GetFloatArray(String, List<Single>)
Declaration
public void GetFloatArray(string name, List<float> values)
Parameters
|
Improve this Doc
View Source
GetInt(Int32)
Declaration
public int GetInt(int nameID)
Parameters
Type |
Name |
Description |
Int32 |
nameID |
|
Returns
|
Improve this Doc
View Source
GetInt(String)
Declaration
public int GetInt(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
|
Improve this Doc
View Source
GetMatrix(Int32)
Declaration
public Matrix4x4 GetMatrix(int nameID)
Parameters
Type |
Name |
Description |
Int32 |
nameID |
|
Returns
|
Improve this Doc
View Source
GetMatrix(String)
Declaration
public Matrix4x4 GetMatrix(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
|
Improve this Doc
View Source
GetMatrixArray(Int32)
Declaration
public Matrix4x4[] GetMatrixArray(int nameID)
Parameters
Type |
Name |
Description |
Int32 |
nameID |
|
Returns
|
Improve this Doc
View Source
GetMatrixArray(Int32, List<Matrix4x4>)
Declaration
public void GetMatrixArray(int nameID, List<Matrix4x4> values)
Parameters
|
Improve this Doc
View Source
GetMatrixArray(String)
Declaration
public Matrix4x4[] GetMatrixArray(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
|
Improve this Doc
View Source
GetMatrixArray(String, List<Matrix4x4>)
Declaration
public void GetMatrixArray(string name, List<Matrix4x4> values)
Parameters
GetPassName(Int32)
Declaration
public string GetPassName(int pass)
Parameters
Type |
Name |
Description |
Int32 |
pass |
|
Returns
GetShaderPassEnabled(String)
Declaration
public bool GetShaderPassEnabled(string passName)
Parameters
Type |
Name |
Description |
String |
passName |
|
Returns
|
Improve this Doc
View Source
GetTag(String, Boolean)
Declaration
public string GetTag(string tag, bool searchFallbacks)
Parameters
Returns
|
Improve this Doc
View Source
GetTag(String, Boolean, String)
Declaration
public string GetTag(string tag, bool searchFallbacks, string defaultValue)
Parameters
Returns
|
Improve this Doc
View Source
GetTexture(Int32)
Declaration
public Texture GetTexture(int nameID)
Parameters
Type |
Name |
Description |
Int32 |
nameID |
|
Returns
|
Improve this Doc
View Source
GetTexture(String)
Declaration
public Texture GetTexture(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
|
Improve this Doc
View Source
GetTextureOffset(Int32)
Declaration
public Vector2 GetTextureOffset(int nameID)
Parameters
Type |
Name |
Description |
Int32 |
nameID |
|
Returns
|
Improve this Doc
View Source
GetTextureOffset(String)
Declaration
public Vector2 GetTextureOffset(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
GetTexturePropertyNameIDs()
Declaration
public int[] GetTexturePropertyNameIDs()
Returns
|
Improve this Doc
View Source
GetTexturePropertyNameIDs(List<Int32>)
Declaration
public void GetTexturePropertyNameIDs(List<int> outNames)
Parameters
GetTexturePropertyNames()
Declaration
public string[] GetTexturePropertyNames()
Returns
|
Improve this Doc
View Source
GetTexturePropertyNames(List<String>)
Declaration
public void GetTexturePropertyNames(List<string> outNames)
Parameters
|
Improve this Doc
View Source
GetTextureScale(Int32)
Declaration
public Vector2 GetTextureScale(int nameID)
Parameters
Type |
Name |
Description |
Int32 |
nameID |
|
Returns
|
Improve this Doc
View Source
GetTextureScale(String)
Declaration
public Vector2 GetTextureScale(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
|
Improve this Doc
View Source
GetVector(Int32)
Declaration
public Vector4 GetVector(int nameID)
Parameters
Type |
Name |
Description |
Int32 |
nameID |
|
Returns
|
Improve this Doc
View Source
GetVector(String)
Declaration
public Vector4 GetVector(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
|
Improve this Doc
View Source
GetVectorArray(Int32)
Declaration
public Vector4[] GetVectorArray(int nameID)
Parameters
Type |
Name |
Description |
Int32 |
nameID |
|
Returns
|
Improve this Doc
View Source
GetVectorArray(Int32, List<Vector4>)
Declaration
public void GetVectorArray(int nameID, List<Vector4> values)
Parameters
|
Improve this Doc
View Source
GetVectorArray(String)
Declaration
public Vector4[] GetVectorArray(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
|
Improve this Doc
View Source
GetVectorArray(String, List<Vector4>)
Declaration
public void GetVectorArray(string name, List<Vector4> values)
Parameters
HasProperty(Int32)
Declaration
public bool HasProperty(int nameID)
Parameters
Type |
Name |
Description |
Int32 |
nameID |
|
Returns
|
Improve this Doc
View Source
HasProperty(String)
Declaration
public bool HasProperty(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
IsKeywordEnabled(String)
Declaration
public bool IsKeywordEnabled(string keyword)
Parameters
Type |
Name |
Description |
String |
keyword |
|
Returns
Lerp(Material, Material, Single)
Declaration
public void Lerp(Material start, Material end, float t)
Parameters
|
Improve this Doc
View Source
SetBuffer(Int32, ComputeBuffer)
Declaration
public void SetBuffer(int nameID, ComputeBuffer value)
Parameters
|
Improve this Doc
View Source
SetBuffer(String, ComputeBuffer)
Declaration
public void SetBuffer(string name, ComputeBuffer value)
Parameters
|
Improve this Doc
View Source
SetColor(Int32, Color)
Declaration
public void SetColor(int nameID, Color value)
Parameters
|
Improve this Doc
View Source
SetColor(String, Color)
Declaration
public void SetColor(string name, Color value)
Parameters
|
Improve this Doc
View Source
SetColorArray(Int32, List<Color>)
Declaration
public void SetColorArray(int nameID, List<Color> values)
Parameters
|
Improve this Doc
View Source
SetColorArray(Int32, Color[])
Declaration
public void SetColorArray(int nameID, Color[] values)
Parameters
|
Improve this Doc
View Source
SetColorArray(String, List<Color>)
Declaration
public void SetColorArray(string name, List<Color> values)
Parameters
|
Improve this Doc
View Source
SetColorArray(String, Color[])
Declaration
public void SetColorArray(string name, Color[] values)
Parameters
|
Improve this Doc
View Source
SetFloat(Int32, Single)
Declaration
public void SetFloat(int nameID, float value)
Parameters
|
Improve this Doc
View Source
SetFloat(String, Single)
Declaration
public void SetFloat(string name, float value)
Parameters
|
Improve this Doc
View Source
SetFloatArray(Int32, List<Single>)
Declaration
public void SetFloatArray(int nameID, List<float> values)
Parameters
|
Improve this Doc
View Source
SetFloatArray(Int32, Single[])
Declaration
public void SetFloatArray(int nameID, float[] values)
Parameters
|
Improve this Doc
View Source
SetFloatArray(String, List<Single>)
Declaration
public void SetFloatArray(string name, List<float> values)
Parameters
|
Improve this Doc
View Source
SetFloatArray(String, Single[])
Declaration
public void SetFloatArray(string name, float[] values)
Parameters
|
Improve this Doc
View Source
SetInt(Int32, Int32)
Declaration
public void SetInt(int nameID, int value)
Parameters
|
Improve this Doc
View Source
SetInt(String, Int32)
Declaration
public void SetInt(string name, int value)
Parameters
|
Improve this Doc
View Source
SetMatrix(Int32, Matrix4x4)
Declaration
public void SetMatrix(int nameID, Matrix4x4 value)
Parameters
|
Improve this Doc
View Source
SetMatrix(String, Matrix4x4)
Declaration
public void SetMatrix(string name, Matrix4x4 value)
Parameters
|
Improve this Doc
View Source
SetMatrixArray(Int32, List<Matrix4x4>)
Declaration
public void SetMatrixArray(int nameID, List<Matrix4x4> values)
Parameters
|
Improve this Doc
View Source
SetMatrixArray(Int32, Matrix4x4[])
Declaration
public void SetMatrixArray(int nameID, Matrix4x4[] values)
Parameters
|
Improve this Doc
View Source
SetMatrixArray(String, List<Matrix4x4>)
Declaration
public void SetMatrixArray(string name, List<Matrix4x4> values)
Parameters
|
Improve this Doc
View Source
SetMatrixArray(String, Matrix4x4[])
Declaration
public void SetMatrixArray(string name, Matrix4x4[] values)
Parameters
SetOverrideTag(String, String)
Declaration
public void SetOverrideTag(string tag, string val)
Parameters
SetPass(Int32)
Declaration
public bool SetPass(int pass)
Parameters
Type |
Name |
Description |
Int32 |
pass |
|
Returns
SetShaderPassEnabled(String, Boolean)
Declaration
public void SetShaderPassEnabled(string passName, bool enabled)
Parameters
|
Improve this Doc
View Source
SetTexture(Int32, Texture)
Declaration
public void SetTexture(int nameID, Texture value)
Parameters
|
Improve this Doc
View Source
SetTexture(String, Texture)
Declaration
public void SetTexture(string name, Texture value)
Parameters
|
Improve this Doc
View Source
SetTextureOffset(Int32, Vector2)
Declaration
public void SetTextureOffset(int nameID, Vector2 value)
Parameters
|
Improve this Doc
View Source
SetTextureOffset(String, Vector2)
Declaration
public void SetTextureOffset(string name, Vector2 value)
Parameters
|
Improve this Doc
View Source
SetTextureScale(Int32, Vector2)
Declaration
public void SetTextureScale(int nameID, Vector2 value)
Parameters
|
Improve this Doc
View Source
SetTextureScale(String, Vector2)
Declaration
public void SetTextureScale(string name, Vector2 value)
Parameters
|
Improve this Doc
View Source
SetVector(Int32, Vector4)
Declaration
public void SetVector(int nameID, Vector4 value)
Parameters
|
Improve this Doc
View Source
SetVector(String, Vector4)
Declaration
public void SetVector(string name, Vector4 value)
Parameters
|
Improve this Doc
View Source
SetVectorArray(Int32, List<Vector4>)
Declaration
public void SetVectorArray(int nameID, List<Vector4> values)
Parameters
|
Improve this Doc
View Source
SetVectorArray(Int32, Vector4[])
Declaration
public void SetVectorArray(int nameID, Vector4[] values)
Parameters
|
Improve this Doc
View Source
SetVectorArray(String, List<Vector4>)
Declaration
public void SetVectorArray(string name, List<Vector4> values)
Parameters
|
Improve this Doc
View Source
SetVectorArray(String, Vector4[])
Declaration
public void SetVectorArray(string name, Vector4[] values)
Parameters
Extension Methods