MaterialDefinition
Describes a VisualElement material.
읽는 시간 1분최근 업데이트: 7시간 전
Definition
- Type: Struct
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Implements: IEquatable<MaterialDefinition>
public struct MaterialDefinition : IEquatable<MaterialDefinition>
Remarks
A MaterialDefinition read from IResolvedStyle.unityMaterial or IStyle.unityMaterial is a copy. To change a material property of an element, read the value, call a method such as MaterialDefinition.SetFloat, and assign the value back to IStyle.unityMaterial.
Constructors
Constructor | Description |
|---|---|
| MaterialDefinition(UnityEngine.Material) | Creates from a Material. |
Properties
Property | Description |
|---|---|
| material | The material to use to render the element. |
Methods
Method | Description |
|---|---|
| GetColor | Gets a color property value by name. |
| GetFloat | Gets a float property value by name. |
| GetTexture | Gets a texture property value by name. |
| GetVector | Gets a vector property value by name. |
| IsEmpty | Help verify whether an asset has been assigned or not. |
| SetColor | Sets a color property value by name. |
| SetFloat | Sets a float property value by name. |
| SetTexture | Sets a texture property value by name. |
| SetVector | Sets a vector property value by name. |
Static Methods
Method | Description |
|---|---|
| FromMaterial | Creates a material definition from a Material. |