Material

Struct Material 

Source
pub struct Material {
Show 13 fields pub m_Name: String, pub m_SavedProperties: UnityPropertySheet, pub m_Shader: PPtr, pub disabledShaderPasses: Option<Vec<String>>, pub m_BuildTextureStacks: Option<Vec<BuildTextureStackReference>>, pub m_CustomRenderQueue: Option<i32>, pub m_DoubleSidedGI: Option<bool>, pub m_EnableInstancingVariants: Option<bool>, pub m_InvalidKeywords: Option<Vec<String>>, pub m_LightmapFlags: Option<u32>, pub m_ShaderKeywords: Option<Enum_Vec_String___String>, pub m_ValidKeywords: Option<Vec<String>>, pub stringTagMap: Option<Vec<(String, String)>>,
}
Expand description

Material is a class of the Unity engine since version 3.4.0. Exert from Unity’s scripting documentation: 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.

Fields§

§m_Name: String

The name of the object.

§m_SavedProperties: UnityPropertySheet§m_Shader: PPtr

The shader used by the material. PPtr<Shader>: (3.4.0 - 2022.3.2f1)

§disabledShaderPasses: Option<Vec<String>>

Vec: (5.6.0f1 - 2022.3.2f1)

§m_BuildTextureStacks: Option<Vec<BuildTextureStackReference>>

Vec: (2020.1.0b1 - 2022.3.2f1)

§m_CustomRenderQueue: Option<i32>

i32: (4.3.0 - 2022.3.2f1)

§m_DoubleSidedGI: Option<bool>

Gets and sets whether the Double Sided Global Illumination setting is enabled for this material. bool: (5.6.2f1 - 2022.3.2f1)

§m_EnableInstancingVariants: Option<bool>

bool: (5.6.0f1 - 2022.3.2f1)

§m_InvalidKeywords: Option<Vec<String>>

Vec: (2021.2.18f1 - 2022.3.2f1)

§m_LightmapFlags: Option<u32>

u32: (5.0.0f4 - 2022.3.2f1)

§m_ShaderKeywords: Option<Enum_Vec_String___String>

An array containing names of the local shader keywords that are currently enabled for this material. Vec: (4.1.0 - 4.7.2); String: (5.0.0f4 - 2022.1.0a16)

§m_ValidKeywords: Option<Vec<String>>

Vec: (2021.2.18f1 - 2022.3.2f1)

§stringTagMap: Option<Vec<(String, String)>>

Vec<(String, String)>: (5.1.0f1 - 2022.3.2f1)

Trait Implementations§

Source§

impl Debug for Material

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Material

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Material

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,