Class MaterialInstanceHelper
Creates material instance for a material associated with a given renderer material index and provide accessor to it.
Inheritance
MaterialInstanceHelper
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 Instance Helper", 12)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.5/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 |
---|---|
bool | Returns true if material instance is initialized. Otherwise, returns false. |