Class Vector2AffordanceReceiver
Affordance receiver applying a Vector2 (Float2) affordance theme. Broadcasts new affordance value with Unity Event.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Receiver.Primitives
Syntax
[AddComponentMenu("Affordance System/Receiver/Primitives/Vector2 Affordance Receiver", 12)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.4/api/UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Receiver.Primitives.Vector2AffordanceReceiver.html")]
public class Vector2AffordanceReceiver : BaseAsyncAffordanceStateReceiver<float2>, IAffordanceStateReceiver<float2>, IAsyncAffordanceStateReceiver, IAffordanceStateReceiver
Properties
affordanceThemeDatum
Affordance theme datum property used as a template for creating the runtime copy used during initialization.
Declaration
public Vector2AffordanceThemeDatumProperty affordanceThemeDatum { get; set; }
Property Value
Type | Description |
---|---|
Vector2AffordanceThemeDatumProperty |
Remarks
This value can be bypassed by directly setting the affordanceTheme at runtime.
See Also
affordanceValue
Bindable variable for current typed affordance value. Updated as scheduled tween jobs complete.
Declaration
protected override BindableVariable<float2> affordanceValue { get; }
Property Value
Type | Description |
---|---|
BindableVariable<float2> |
Overrides
See Also
defaultAffordanceTheme
The default affordance theme that is cloned and assigned to affordanceTheme during initialization if that property is not set.
Declaration
protected override BaseAffordanceTheme<float2> defaultAffordanceTheme { get; }
Property Value
Type | Description |
---|---|
BaseAffordanceTheme<float2> |
Overrides
Remarks
This should typically be the theme contained in a serialized ScriptableObject asset reference.
See Also
valueUpdated
The event that is called when the current affordance value is updated.
Declaration
public Vector2UnityEvent valueUpdated { get; set; }
Property Value
Type | Description |
---|---|
Vector2UnityEvent |
Methods
GenerateNewAffordanceThemeInstance()
Automatically called by Unity during initialization to create a new instance of the affordance theme used for this receiver.
Declaration
protected override BaseAffordanceTheme<float2> GenerateNewAffordanceThemeInstance()
Returns
Type | Description |
---|---|
BaseAffordanceTheme<float2> | Returns a new instance of the affordance theme. |
Overrides
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
ScheduleTweenJob(ref TweenJobData<float2>)
Generate the tween job from the given job data and schedule the job for execution on a worker thread.
Declaration
protected override JobHandle ScheduleTweenJob(ref TweenJobData<float2> jobData)
Parameters
Type | Name | Description |
---|---|---|
TweenJobData<float2> | jobData |
Returns
Type | Description |
---|---|
JobHandle | Returns the handle identifying the scheduled job. |