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
UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
UnityEngine.Object.FindFirstObjectByType<T>()
UnityEngine.Object.FindAnyObjectByType<T>()
UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
Namespace: UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Rendering
Syntax
[AddComponentMenu("Affordance System/Rendering/Material Property Block Helper", 12)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.4/api/UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Rendering.MaterialPropertyBlockHelper.html")]
public class MaterialPropertyBlockHelper : MaterialHelperBase
Methods
GetMaterialPropertyBlock(Boolean)
Get material property block associated the the material index set in the inspector.
Declaration
public MaterialPropertyBlock GetMaterialPropertyBlock(bool markPropertyBlockAsDirty = true)
Parameters
Type | Name | Description |
---|---|---|
Boolean | 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()