Show / Hide Table of Contents

Class Material

Inheritance
Object
Object
Material
Inherited Members
Object.GetInstanceID()
Object.GetHashCode()
Object.Equals(Object)
Object.name
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate(Object, Transform, Boolean)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Instantiate<T>(T, Transform, Boolean)
Object.Destroy(Object, Single)
Object.Destroy(Object)
Object.DestroyImmediate(Object, Boolean)
Object.DestroyImmediate(Object)
Object.FindObjectsOfType(Type)
Object.DontDestroyOnLoad(Object)
Object.hideFlags
Object.DestroyObject(Object, Single)
Object.DestroyObject(Object)
Object.FindSceneObjectsOfType(Type)
Object.FindObjectsOfTypeIncludingAssets(Type)
Object.FindObjectsOfType<T>()
Object.FindObjectOfType<T>()
Object.FindObjectsOfTypeAll(Type)
Object.FindObjectOfType(Type)
Object.ToString()
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Namespace: UnityEngine
Assembly: UnityEngine.dll
Syntax
public class Material : Object

Constructors

| Improve this Doc View Source

Material(Material)

Declaration
public Material(Material source)
Parameters
Type Name Description
Material source
| 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
Type Description
Color

doubleSidedGI

Declaration
public bool doubleSidedGI { get; set; }
Property Value
Type Description
Boolean

enableInstancing

Declaration
public bool enableInstancing { get; set; }
Property Value
Type Description
Boolean

globalIlluminationFlags

Declaration
public MaterialGlobalIlluminationFlags globalIlluminationFlags { get; set; }
Property Value
Type Description
MaterialGlobalIlluminationFlags
| Improve this Doc View Source

mainTexture

Declaration
public Texture mainTexture { get; set; }
Property Value
Type Description
Texture
| Improve this Doc View Source

mainTextureOffset

Declaration
public Vector2 mainTextureOffset { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

mainTextureScale

Declaration
public Vector2 mainTextureScale { get; set; }
Property Value
Type Description
Vector2

passCount

Declaration
public int passCount { get; }
Property Value
Type Description
Int32

renderQueue

Declaration
public int renderQueue { get; set; }
Property Value
Type Description
Int32

shader

Declaration
public Shader shader { get; set; }
Property Value
Type Description
Shader
| Improve this Doc View Source

shaderKeywords

Declaration
public string[] shaderKeywords { get; set; }
Property Value
Type Description
String[]

Methods

CopyPropertiesFromMaterial(Material)

Declaration
public void CopyPropertiesFromMaterial(Material mat)
Parameters
Type Name Description
Material mat
| 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
Type Description
Material

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
Type Description
Int32
| Improve this Doc View Source

GetColor(Int32)

Declaration
public Color GetColor(int nameID)
Parameters
Type Name Description
Int32 nameID
Returns
Type Description
Color
| Improve this Doc View Source

GetColor(String)

Declaration
public Color GetColor(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Color
| Improve this Doc View Source

GetColorArray(Int32)

Declaration
public Color[] GetColorArray(int nameID)
Parameters
Type Name Description
Int32 nameID
Returns
Type Description
Color[]
| Improve this Doc View Source

GetColorArray(Int32, List<Color>)

Declaration
public void GetColorArray(int nameID, List<Color> values)
Parameters
Type Name Description
Int32 nameID
List<Color> values
| Improve this Doc View Source

GetColorArray(String)

Declaration
public Color[] GetColorArray(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Color[]
| Improve this Doc View Source

GetColorArray(String, List<Color>)

Declaration
public void GetColorArray(string name, List<Color> values)
Parameters
Type Name Description
String name
List<Color> values
| Improve this Doc View Source

GetFloat(Int32)

Declaration
public float GetFloat(int nameID)
Parameters
Type Name Description
Int32 nameID
Returns
Type Description
Single
| Improve this Doc View Source

GetFloat(String)

Declaration
public float GetFloat(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Single
| Improve this Doc View Source

GetFloatArray(Int32)

Declaration
public float[] GetFloatArray(int nameID)
Parameters
Type Name Description
Int32 nameID
Returns
Type Description
Single[]
| Improve this Doc View Source

GetFloatArray(Int32, List<Single>)

Declaration
public void GetFloatArray(int nameID, List<float> values)
Parameters
Type Name Description
Int32 nameID
List<Single> values
| Improve this Doc View Source

GetFloatArray(String)

Declaration
public float[] GetFloatArray(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Single[]
| Improve this Doc View Source

GetFloatArray(String, List<Single>)

Declaration
public void GetFloatArray(string name, List<float> values)
Parameters
Type Name Description
String name
List<Single> values
| Improve this Doc View Source

GetInt(Int32)

Declaration
public int GetInt(int nameID)
Parameters
Type Name Description
Int32 nameID
Returns
Type Description
Int32
| Improve this Doc View Source

GetInt(String)

Declaration
public int GetInt(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Int32
| Improve this Doc View Source

GetMatrix(Int32)

Declaration
public Matrix4x4 GetMatrix(int nameID)
Parameters
Type Name Description
Int32 nameID
Returns
Type Description
Matrix4x4
| Improve this Doc View Source

GetMatrix(String)

Declaration
public Matrix4x4 GetMatrix(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Matrix4x4
| Improve this Doc View Source

GetMatrixArray(Int32)

Declaration
public Matrix4x4[] GetMatrixArray(int nameID)
Parameters
Type Name Description
Int32 nameID
Returns
Type Description
Matrix4x4[]
| Improve this Doc View Source

GetMatrixArray(Int32, List<Matrix4x4>)

Declaration
public void GetMatrixArray(int nameID, List<Matrix4x4> values)
Parameters
Type Name Description
Int32 nameID
List<Matrix4x4> values
| Improve this Doc View Source

GetMatrixArray(String)

Declaration
public Matrix4x4[] GetMatrixArray(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Matrix4x4[]
| Improve this Doc View Source

GetMatrixArray(String, List<Matrix4x4>)

Declaration
public void GetMatrixArray(string name, List<Matrix4x4> values)
Parameters
Type Name Description
String name
List<Matrix4x4> values

GetPassName(Int32)

Declaration
public string GetPassName(int pass)
Parameters
Type Name Description
Int32 pass
Returns
Type Description
String

GetShaderPassEnabled(String)

Declaration
public bool GetShaderPassEnabled(string passName)
Parameters
Type Name Description
String passName
Returns
Type Description
Boolean
| Improve this Doc View Source

GetTag(String, Boolean)

Declaration
public string GetTag(string tag, bool searchFallbacks)
Parameters
Type Name Description
String tag
Boolean searchFallbacks
Returns
Type Description
String
| Improve this Doc View Source

GetTag(String, Boolean, String)

Declaration
public string GetTag(string tag, bool searchFallbacks, string defaultValue)
Parameters
Type Name Description
String tag
Boolean searchFallbacks
String defaultValue
Returns
Type Description
String
| Improve this Doc View Source

GetTexture(Int32)

Declaration
public Texture GetTexture(int nameID)
Parameters
Type Name Description
Int32 nameID
Returns
Type Description
Texture
| Improve this Doc View Source

GetTexture(String)

Declaration
public Texture GetTexture(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Texture
| Improve this Doc View Source

GetTextureOffset(Int32)

Declaration
public Vector2 GetTextureOffset(int nameID)
Parameters
Type Name Description
Int32 nameID
Returns
Type Description
Vector2
| Improve this Doc View Source

GetTextureOffset(String)

Declaration
public Vector2 GetTextureOffset(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Vector2

GetTexturePropertyNameIDs()

Declaration
public int[] GetTexturePropertyNameIDs()
Returns
Type Description
Int32[]
| Improve this Doc View Source

GetTexturePropertyNameIDs(List<Int32>)

Declaration
public void GetTexturePropertyNameIDs(List<int> outNames)
Parameters
Type Name Description
List<Int32> outNames

GetTexturePropertyNames()

Declaration
public string[] GetTexturePropertyNames()
Returns
Type Description
String[]
| Improve this Doc View Source

GetTexturePropertyNames(List<String>)

Declaration
public void GetTexturePropertyNames(List<string> outNames)
Parameters
Type Name Description
List<String> outNames
| Improve this Doc View Source

GetTextureScale(Int32)

Declaration
public Vector2 GetTextureScale(int nameID)
Parameters
Type Name Description
Int32 nameID
Returns
Type Description
Vector2
| Improve this Doc View Source

GetTextureScale(String)

Declaration
public Vector2 GetTextureScale(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Vector2
| Improve this Doc View Source

GetVector(Int32)

Declaration
public Vector4 GetVector(int nameID)
Parameters
Type Name Description
Int32 nameID
Returns
Type Description
Vector4
| Improve this Doc View Source

GetVector(String)

Declaration
public Vector4 GetVector(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Vector4
| Improve this Doc View Source

GetVectorArray(Int32)

Declaration
public Vector4[] GetVectorArray(int nameID)
Parameters
Type Name Description
Int32 nameID
Returns
Type Description
Vector4[]
| Improve this Doc View Source

GetVectorArray(Int32, List<Vector4>)

Declaration
public void GetVectorArray(int nameID, List<Vector4> values)
Parameters
Type Name Description
Int32 nameID
List<Vector4> values
| Improve this Doc View Source

GetVectorArray(String)

Declaration
public Vector4[] GetVectorArray(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Vector4[]
| Improve this Doc View Source

GetVectorArray(String, List<Vector4>)

Declaration
public void GetVectorArray(string name, List<Vector4> values)
Parameters
Type Name Description
String name
List<Vector4> values

HasProperty(Int32)

Declaration
public bool HasProperty(int nameID)
Parameters
Type Name Description
Int32 nameID
Returns
Type Description
Boolean
| Improve this Doc View Source

HasProperty(String)

Declaration
public bool HasProperty(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Boolean

IsKeywordEnabled(String)

Declaration
public bool IsKeywordEnabled(string keyword)
Parameters
Type Name Description
String keyword
Returns
Type Description
Boolean

Lerp(Material, Material, Single)

Declaration
public void Lerp(Material start, Material end, float t)
Parameters
Type Name Description
Material start
Material end
Single t
| Improve this Doc View Source

SetBuffer(Int32, ComputeBuffer)

Declaration
public void SetBuffer(int nameID, ComputeBuffer value)
Parameters
Type Name Description
Int32 nameID
ComputeBuffer value
| Improve this Doc View Source

SetBuffer(String, ComputeBuffer)

Declaration
public void SetBuffer(string name, ComputeBuffer value)
Parameters
Type Name Description
String name
ComputeBuffer value
| Improve this Doc View Source

SetColor(Int32, Color)

Declaration
public void SetColor(int nameID, Color value)
Parameters
Type Name Description
Int32 nameID
Color value
| Improve this Doc View Source

SetColor(String, Color)

Declaration
public void SetColor(string name, Color value)
Parameters
Type Name Description
String name
Color value
| Improve this Doc View Source

SetColorArray(Int32, List<Color>)

Declaration
public void SetColorArray(int nameID, List<Color> values)
Parameters
Type Name Description
Int32 nameID
List<Color> values
| Improve this Doc View Source

SetColorArray(Int32, Color[])

Declaration
public void SetColorArray(int nameID, Color[] values)
Parameters
Type Name Description
Int32 nameID
Color[] values
| Improve this Doc View Source

SetColorArray(String, List<Color>)

Declaration
public void SetColorArray(string name, List<Color> values)
Parameters
Type Name Description
String name
List<Color> values
| Improve this Doc View Source

SetColorArray(String, Color[])

Declaration
public void SetColorArray(string name, Color[] values)
Parameters
Type Name Description
String name
Color[] values
| Improve this Doc View Source

SetFloat(Int32, Single)

Declaration
public void SetFloat(int nameID, float value)
Parameters
Type Name Description
Int32 nameID
Single value
| Improve this Doc View Source

SetFloat(String, Single)

Declaration
public void SetFloat(string name, float value)
Parameters
Type Name Description
String name
Single value
| Improve this Doc View Source

SetFloatArray(Int32, List<Single>)

Declaration
public void SetFloatArray(int nameID, List<float> values)
Parameters
Type Name Description
Int32 nameID
List<Single> values
| Improve this Doc View Source

SetFloatArray(Int32, Single[])

Declaration
public void SetFloatArray(int nameID, float[] values)
Parameters
Type Name Description
Int32 nameID
Single[] values
| Improve this Doc View Source

SetFloatArray(String, List<Single>)

Declaration
public void SetFloatArray(string name, List<float> values)
Parameters
Type Name Description
String name
List<Single> values
| Improve this Doc View Source

SetFloatArray(String, Single[])

Declaration
public void SetFloatArray(string name, float[] values)
Parameters
Type Name Description
String name
Single[] values
| Improve this Doc View Source

SetInt(Int32, Int32)

Declaration
public void SetInt(int nameID, int value)
Parameters
Type Name Description
Int32 nameID
Int32 value
| Improve this Doc View Source

SetInt(String, Int32)

Declaration
public void SetInt(string name, int value)
Parameters
Type Name Description
String name
Int32 value
| Improve this Doc View Source

SetMatrix(Int32, Matrix4x4)

Declaration
public void SetMatrix(int nameID, Matrix4x4 value)
Parameters
Type Name Description
Int32 nameID
Matrix4x4 value
| Improve this Doc View Source

SetMatrix(String, Matrix4x4)

Declaration
public void SetMatrix(string name, Matrix4x4 value)
Parameters
Type Name Description
String name
Matrix4x4 value
| Improve this Doc View Source

SetMatrixArray(Int32, List<Matrix4x4>)

Declaration
public void SetMatrixArray(int nameID, List<Matrix4x4> values)
Parameters
Type Name Description
Int32 nameID
List<Matrix4x4> values
| Improve this Doc View Source

SetMatrixArray(Int32, Matrix4x4[])

Declaration
public void SetMatrixArray(int nameID, Matrix4x4[] values)
Parameters
Type Name Description
Int32 nameID
Matrix4x4[] values
| Improve this Doc View Source

SetMatrixArray(String, List<Matrix4x4>)

Declaration
public void SetMatrixArray(string name, List<Matrix4x4> values)
Parameters
Type Name Description
String name
List<Matrix4x4> values
| Improve this Doc View Source

SetMatrixArray(String, Matrix4x4[])

Declaration
public void SetMatrixArray(string name, Matrix4x4[] values)
Parameters
Type Name Description
String name
Matrix4x4[] values

SetOverrideTag(String, String)

Declaration
public void SetOverrideTag(string tag, string val)
Parameters
Type Name Description
String tag
String val

SetPass(Int32)

Declaration
public bool SetPass(int pass)
Parameters
Type Name Description
Int32 pass
Returns
Type Description
Boolean

SetShaderPassEnabled(String, Boolean)

Declaration
public void SetShaderPassEnabled(string passName, bool enabled)
Parameters
Type Name Description
String passName
Boolean enabled
| Improve this Doc View Source

SetTexture(Int32, Texture)

Declaration
public void SetTexture(int nameID, Texture value)
Parameters
Type Name Description
Int32 nameID
Texture value
| Improve this Doc View Source

SetTexture(String, Texture)

Declaration
public void SetTexture(string name, Texture value)
Parameters
Type Name Description
String name
Texture value
| Improve this Doc View Source

SetTextureOffset(Int32, Vector2)

Declaration
public void SetTextureOffset(int nameID, Vector2 value)
Parameters
Type Name Description
Int32 nameID
Vector2 value
| Improve this Doc View Source

SetTextureOffset(String, Vector2)

Declaration
public void SetTextureOffset(string name, Vector2 value)
Parameters
Type Name Description
String name
Vector2 value
| Improve this Doc View Source

SetTextureScale(Int32, Vector2)

Declaration
public void SetTextureScale(int nameID, Vector2 value)
Parameters
Type Name Description
Int32 nameID
Vector2 value
| Improve this Doc View Source

SetTextureScale(String, Vector2)

Declaration
public void SetTextureScale(string name, Vector2 value)
Parameters
Type Name Description
String name
Vector2 value
| Improve this Doc View Source

SetVector(Int32, Vector4)

Declaration
public void SetVector(int nameID, Vector4 value)
Parameters
Type Name Description
Int32 nameID
Vector4 value
| Improve this Doc View Source

SetVector(String, Vector4)

Declaration
public void SetVector(string name, Vector4 value)
Parameters
Type Name Description
String name
Vector4 value
| Improve this Doc View Source

SetVectorArray(Int32, List<Vector4>)

Declaration
public void SetVectorArray(int nameID, List<Vector4> values)
Parameters
Type Name Description
Int32 nameID
List<Vector4> values
| Improve this Doc View Source

SetVectorArray(Int32, Vector4[])

Declaration
public void SetVectorArray(int nameID, Vector4[] values)
Parameters
Type Name Description
Int32 nameID
Vector4[] values
| Improve this Doc View Source

SetVectorArray(String, List<Vector4>)

Declaration
public void SetVectorArray(string name, List<Vector4> values)
Parameters
Type Name Description
String name
List<Vector4> values
| Improve this Doc View Source

SetVectorArray(String, Vector4[])

Declaration
public void SetVectorArray(string name, Vector4[] values)
Parameters
Type Name Description
String name
Vector4[] values

Extension Methods

MustExtensions.MustBeEqual<T>(T, T)
MustExtensions.MustBeEqual<T>(T, T, String)
MustExtensions.MustNotBeEqual<T>(T, T)
MustExtensions.MustNotBeEqual<T>(T, T, String)
MustExtensions.MustBeNull<T>(T)
MustExtensions.MustBeNull<T>(T, String)
MustExtensions.MustNotBeNull<T>(T)
MustExtensions.MustNotBeNull<T>(T, String)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX