Class MaterialPropertyBlockHelper
Bridge between components needing to write to a renderer's material property block. Allows multiple components to handle their own material properties and write them to a central space and update it only as needed.
Inheritance
MaterialPropertyBlockHelper
Inherited Members
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Rendering
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("Affordance System/Rendering/Material Property Block Helper", 12)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.5/api/UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Rendering.MaterialPropertyBlockHelper.html")]
public class MaterialPropertyBlockHelper : MaterialHelperBase
Methods
GetMaterialPropertyBlock(bool)
Get material property block associated the the material index set in the inspector.
Declaration
public MaterialPropertyBlock GetMaterialPropertyBlock(bool markPropertyBlockAsDirty = true)
Parameters
Type | Name | Description |
---|---|---|
bool | markPropertyBlockAsDirty | If true, marks property block as dirty to be updated at the end of the frame. |
Returns
Type | Description |
---|---|
MaterialPropertyBlock | Material property block for associated material index. |
Initialize()
Initialize the property block or material instance.
Declaration
protected override void Initialize()
Overrides
LateUpdate()
See MonoBehaviour.
Declaration
protected void LateUpdate()
OnDestroy()
See MonoBehaviour.
Declaration
protected void OnDestroy()