Class MaterialInstance
A Material instance.
[DataContract("MaterialInstance")]
public class MaterialInstance : IEquatable<MaterialInstance>
- Inheritance
-
MaterialInstance
- Implements
Constructors
MaterialInstance()
Initializes a new instance of the MaterialInstance class.
public MaterialInstance()
MaterialInstance(Material)
Initializes a new instance of the MaterialInstance class.
public MaterialInstance(Material material)
Parameters
material
MaterialThe material.
Properties
IsShadowCaster
Gets or sets if this instance is casting shadows.
[DataMember(20)]
[Display("Cast Shadows?", null)]
public bool IsShadowCaster { get; set; }
Property Value
- bool
A boolean indicating whether this instance is casting shadows. Default is
true
.
Material
Gets or sets the material.
[DataMember(10)]
public Material Material { get; set; }
Property Value
- Material
The material.
Methods
Equals(MaterialInstance)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(MaterialInstance other)
Parameters
other
MaterialInstanceAn object to compare with this object.
Returns
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Operators
operator ==(MaterialInstance, MaterialInstance)
public static bool operator ==(MaterialInstance left, MaterialInstance right)
Parameters
left
MaterialInstanceright
MaterialInstance
Returns
implicit operator MaterialInstance(Material)
Performs an explicit conversion from Material to MaterialInstance.
public static implicit operator MaterialInstance(Material material)
Parameters
material
MaterialThe material.
Returns
- MaterialInstance
The result of the conversion.
operator !=(MaterialInstance, MaterialInstance)
public static bool operator !=(MaterialInstance left, MaterialInstance right)
Parameters
left
MaterialInstanceright
MaterialInstance