Class MaterialInstanceHelper
Creates material instance for a material associated with a given renderer material index and provide accessor to it.
Inheritance
MaterialInstanceHelper
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 Instance Helper", 12)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.4/api/UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Rendering.MaterialInstanceHelper.html")]
public class MaterialInstanceHelper : MaterialHelperBase
Methods
Initialize()
Initialize the property block or material instance.
Declaration
protected override void Initialize()
Overrides
OnDestroy()
See MonoBehaviour.
Declaration
protected void OnDestroy()
TryGetMaterialInstance(out Material)
Try to get initialized material instance as configured on the component.
Declaration
public bool TryGetMaterialInstance(out Material materialInstance)
Parameters
Type | Name | Description |
---|---|---|
Material | materialInstance | Material instance. Will be null if invalid. |
Returns
Type | Description |
---|---|
Boolean | Returns true if material instance is initialized. Otherwise, returns false. |