Class Vector2MaterialPropertyAffordanceReceiver
Apply affordance to material property block Vector2 property.
Inheritance
Vector2MaterialPropertyAffordanceReceiver
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.Receiver.Rendering
Syntax
[AddComponentMenu("Affordance System/Receiver/Rendering/Vector2 Material Property Affordance Receiver", 12)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.4/api/UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Receiver.Rendering.Vector2MaterialPropertyAffordanceReceiver.html")]
[RequireComponent(typeof(MaterialPropertyBlockHelper))]
public class Vector2MaterialPropertyAffordanceReceiver : Vector2AffordanceReceiver, IAffordanceStateReceiver<float2>, IAsyncAffordanceStateReceiver, IAffordanceStateReceiver
Properties
materialPropertyBlockHelper
Material Property Block Helper component reference used to set material properties.
Declaration
public MaterialPropertyBlockHelper materialPropertyBlockHelper { get; set; }
Property Value
Type | Description |
---|---|
MaterialPropertyBlockHelper |
vector2PropertyName
Shader property name to set the vector value of.
Declaration
public string vector2PropertyName { get; set; }
Property Value
Type | Description |
---|---|
String |
Methods
Awake()
See MonoBehaviour.
Declaration
protected override void Awake()
Overrides
UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Receiver.BaseAffordanceStateReceiver<Unity.Mathematics.float2>.Awake()
GetCurrentValueForCapture()
Function used to get the current value of the receiver's target property. Is overriden for material properties or other targets where the initial state exists outside the receiver.
Declaration
protected override float2 GetCurrentValueForCapture()
Returns
Type | Description |
---|---|
float2 | Initial value. |
Overrides
UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Receiver.BaseAffordanceStateReceiver<Unity.Mathematics.float2>.GetCurrentValueForCapture()
OnAffordanceValueUpdated(float2)
Method that is called when the typed affordance value is updated. Implement this method in a derived class to apply the current affordance value, such as setting a material property or raising an event.
Declaration
protected override void OnAffordanceValueUpdated(float2 newValue)
Parameters
Type | Name | Description |
---|---|---|
float2 | newValue |
Overrides
OnValidate()
See MonoBehaviour.
Declaration
protected void OnValidate()