Skip to content

Commit 60d4b5a

Browse files
author
Unity Technologies
committed
com.unity.xr.interaction.toolkit@2.3.2
## [2.3.2] - 2023-04-28 ### Changed - Changed XRI project validation to only log errors to the console, not warnings. - Updated `XRPokeFollowAffordance` smoothing property default from 8 to 16 to make it feel more responsive. ### Fixed - Added additional checks against AR Foundation 5.0 and newer so deprecation messages and the use of the newer XR Origin (AR) is hidden when using AR Foundation 4.2 and older. - Fixed GC allocations produced each frame by `XRPokeInteractor.UpdateUIModel`. - Fixed frame-timing for Locomotion Input Tests when running in batch mode. - `XRInteractableAffordanceStateProvider` Fixes: - Activated state was lower priority than selected, which because select is not exited, this was causing issues with it not appearing. - There were some racing coroutines between select and activate, and now trigger a new animation blocks previous animations - Leaving the select state cancels select animations that might not have completed - Leaving activated state cancels activate animations that might not have completed - Fixed repeat audio issue in the `AudioAffordanceReceiver` by adding extra conditions which treat select as a modifier to hover, and activated as a modifier to select. Doing this prevents triggering repeat audio clips that shouldn't fire, like releasing the activate trigger, or releasing the select trigger while still hovering. - Fixed `XRPokeLogic` issue where poking from behind objects would sometimes trigger select incorrectly. - Fixed `XRPokeLogic` issue where depth percent was incorrectly calculated using an exponential value which would result in poke buttons feeling disconnected from the poke interactor position.
1 parent 4cd52a8 commit 60d4b5a

25 files changed

+335
-300
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
<!-- Headers should be listed in this order: Added, Changed, Deprecated, Removed, Fixed, Security -->
8+
## [2.3.2] - 2023-04-28
9+
10+
### Changed
11+
- Changed XRI project validation to only log errors to the console, not warnings.
12+
- Updated `XRPokeFollowAffordance` smoothing property default from 8 to 16 to make it feel more responsive.
13+
14+
### Fixed
15+
- Added additional checks against AR Foundation 5.0 and newer so deprecation messages and the use of the newer XR Origin (AR) is hidden when using AR Foundation 4.2 and older.
16+
- Fixed GC allocations produced each frame by `XRPokeInteractor.UpdateUIModel`.
17+
- Fixed frame-timing for Locomotion Input Tests when running in batch mode.
18+
- `XRInteractableAffordanceStateProvider` Fixes:
19+
- Activated state was lower priority than selected, which because select is not exited, this was causing issues with it not appearing.
20+
- There were some racing coroutines between select and activate, and now trigger a new animation blocks previous animations
21+
- Leaving the select state cancels select animations that might not have completed
22+
- Leaving activated state cancels activate animations that might not have completed
23+
- Fixed repeat audio issue in the `AudioAffordanceReceiver` by adding extra conditions which treat select as a modifier to hover, and activated as a modifier to select. Doing this prevents triggering repeat audio clips that shouldn't fire, like releasing the activate trigger, or releasing the select trigger while still hovering.
24+
- Fixed `XRPokeLogic` issue where poking from behind objects would sometimes trigger select incorrectly.
25+
- Fixed `XRPokeLogic` issue where depth percent was incorrectly calculated using an exponential value which would result in poke buttons feeling disconnected from the poke interactor position.
26+
827
## [2.3.1] - 2023-03-27
928

1029
### Added

Documentation~/affordance-system.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ The XR Interaction Toolkit package provides an affordance system which enables u
88

99
The [XR Interactable Affordance State Provider](xr-interactable-affordance-state-provider.md) connects to an interactable component and reads the interaction state as it changes (Hover, Select, or Activate) to determine and provide the appropriate [Affordance State](xref:UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.State.AffordanceStateShortcuts) to any affordance receivers subscribed to this particular provider. It is also possible to update an affordance state directly from a script without the need for checking the state of an interactable, such as through a network synchronization script. Writing a custom provider is also possible, extended the possibilities to use the affordance system for non-interactable objects as well.
1010

11+
Note that if you are using click animations for Selected or Activated states, affordance transitions won't be propagated until after the animation is completed.
12+
1113
## Affordance receivers
1214

1315
Affordance receivers are components that receive `Affordance State` change events and then perform specific effects using the referenced theme or configuration. Many affordance receivers handle animating tweens to achieve specific visual effects. There are various affordance receiver components for different primitive data types, such as `Color` or `Vector3` or `Float`. Custom affordance receivers can also be built to achieve a variety of effects depending on the properties you wish to enhance on or around a given object.
@@ -36,6 +38,17 @@ From here we will be able to add affordance receivers to add effects to the inte
3638

3739
![affordance-receiver](images/affordance-receiver.png)
3840

41+
### Audio Affordance Receiver
42+
43+
It is possible to add audio effects when transitionning between affordance states using the Audio Affordance Receiver.
44+
Like other affordance receivers, you simply add a theme and connect the affordance state provider reference, but unlike other themes, audio has one shot clips that play when transitionning between states. Because target values are not smoothly blended like with other receivers, the Audio Affordance Receiver has extra considerations on which states are being entered and exited, to avoid playing clips that shouldn't be played.
45+
46+
In practice, when moving from hover to select, select is considered a "modifier" to hover. This means that if releasing select, when holding an object for instance, the hover entered sound effect won't play again if the object previously select is still hovered on release. Similarly, when triggering the activated state from select, the select exited sound effect won't play, as it is considered a "modifier" to activated.
47+
48+
Finally, as mentionned in the Affordance State Provider section, if you are using click animations for Selected or Activated states, repeated activation of activated trigger, faster than the click animation duration, won't trigger affordance audio clips until after the animation is completed. Feel free to disable activated click animations if this is a concern.
49+
50+
![audio-affordance-receiver](audio-affordance-receiver.png)
51+
3952
### Adding a theme
4053

4154
Next we will create and setup the theme asset. In the Project window, navigate to a folder you wish to store your themes in. Open the **Assets** menu and navigate to **Create** &gt; **Affordance Theme** &gt; **Color Affordance Theme** to create the new [ScriptableObject](https://docs.unity3d.com/Manual/class-ScriptableObject.html) asset. Click on the newly created theme to bring up the Inspector window. By default, all colors will be set to black and transparent. Feel free to set the colors to match the aesthetic you are looking for. Below is an image of a fully configured theme included with the Starter Assets.
64 KB
Loading

Documentation~/includes/version.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.1
1+
2.3.2

Documentation~/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To install this package (minimum version: 2.0.4), follow the [installation instr
1818
This package was not listed in the Editor manifest in earlier versions of Unity 2021. Due to this, installation is a manual process. To install this package:
1919
1. Open the project that you plan to use.
2020
1. Click the following link to bring up the **Add package by name** window in Package Manager:
21-
[com.unity.xr.interaction.toolkit](com.unity3d.kharma:upmpackage/com.unity.xr.interaction.toolkit@2.3.1)
21+
[com.unity.xr.interaction.toolkit](com.unity3d.kharma:upmpackage/com.unity.xr.interaction.toolkit@2.3.2)
2222

2323
![installation-add-package-by-name](images/installation-add-package-by-name.png)
2424

Editor/AR/Interactables/ARBaseGestureInteractableEditor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,19 @@ protected override void OnEnable()
4646
protected override void DrawProperties()
4747
{
4848
base.DrawProperties();
49+
50+
#if AR_FOUNDATION_5_0_OR_NEWER
4951
EditorGUILayout.PropertyField(m_XROrigin, BaseGestureContents.xrOrigin);
5052
using (new EditorGUI.IndentLevelScope())
5153
{
5254
if (m_ARSessionOrigin.objectReferenceValue != null)
5355
EditorGUILayout.HelpBox(BaseGestureContents.arSessionOriginDeprecated.text, MessageType.Warning);
56+
5457
EditorGUILayout.PropertyField(m_ARSessionOrigin, BaseGestureContents.arSessionOrigin);
5558
}
59+
#else
60+
EditorGUILayout.PropertyField(m_ARSessionOrigin, BaseGestureContents.arSessionOrigin);
61+
#endif
5662

5763
EditorGUILayout.PropertyField(m_ExcludeUITouches, BaseGestureContents.excludeUITouches);
5864
}

Editor/AR/Interactors/ARGestureInteractorEditor.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,18 @@ protected override void OnEnable()
4141
protected override void DrawProperties()
4242
{
4343
base.DrawProperties();
44+
#if AR_FOUNDATION_5_0_OR_NEWER
4445
EditorGUILayout.PropertyField(m_XROrigin, Contents.xrOrigin);
4546
using (new EditorGUI.IndentLevelScope())
4647
{
4748
if (m_ARSessionOrigin.objectReferenceValue != null)
4849
EditorGUILayout.HelpBox(Contents.arSessionOriginDeprecated.text, MessageType.Warning);
50+
4951
EditorGUILayout.PropertyField(m_ARSessionOrigin, Contents.arSessionOrigin);
5052
}
53+
#else
54+
EditorGUILayout.PropertyField(m_ARSessionOrigin, Contents.arSessionOrigin);
55+
#endif
5156
}
5257
}
5358
}

Editor/CreateUtils.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,13 +655,15 @@ static float GetScaledRadius(SphereCollider collider, float radius)
655655
}
656656

657657
#if AR_FOUNDATION_PRESENT
658+
#if AR_FOUNDATION_5_0_OR_NEWER
658659
[MenuItem("GameObject/XR/XR Origin (AR)", false, 10), UsedImplicitly]
659660
#pragma warning disable IDE0051 // Remove unused private members -- Editor Menu Item
660661
static void CreateXROriginForAR(MenuCommand menuCommand)
661662
#pragma warning restore IDE0051
662663
{
663664
Finalize(CreateXROriginWithParent(menuCommand?.GetContextTransform(), HardwareTarget.AR, InputType.ActionBased));
664665
}
666+
#endif
665667

666668
[MenuItem("GameObject/XR/AR Gesture Interactor", false, 10), UsedImplicitly]
667669
#pragma warning disable IDE0051 // Remove unused private members -- Editor Menu Item

Editor/ProjectValidation/XRInteractionProjectValidation.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ public static void GetCurrentValidationIssues(List<BuildValidationRule> issues)
6969
/// Logs validation issues to console.
7070
/// </summary>
7171
/// <returns>Returns <see langword="true"/> if there were any errors that should stop the build.</returns>
72-
internal static bool LogBuildValidationIssues()
72+
/// <remarks>Only errors are logged to the console. Warnings are not.</remarks>
73+
internal static bool LogBuildValidationErrors()
7374
{
7475
var issues = new List<BuildValidationRule>();
7576
GetCurrentValidationIssues(issues);
@@ -82,8 +83,6 @@ internal static bool LogBuildValidationIssues()
8283
{
8384
if (result.Error)
8485
Debug.LogError(result.Message);
85-
else
86-
Debug.LogWarning(result.Message);
8786

8887
anyErrors |= result.Error;
8988
}
@@ -96,4 +95,4 @@ internal static bool LogBuildValidationIssues()
9695
return anyErrors;
9796
}
9897
}
99-
}
98+
}

Editor/ProjectValidation/XRInteractionProjectValidationRulesSetup.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static XRInteractionProjectValidationRulesSetup()
3131
{
3232
if (playModeState == PlayModeStateChange.EnteredPlayMode)
3333
{
34-
var playmodeIssues = XRInteractionProjectValidation.LogBuildValidationIssues();
34+
var playmodeIssues = XRInteractionProjectValidation.LogBuildValidationErrors();
3535
if (playmodeIssues)
3636
{
3737
EditorApplication.ExitPlaymode();
@@ -304,8 +304,8 @@ static bool ConsoleErrorDoubleClicked(int instanceId, int line)
304304

305305
public void OnPreprocessBuild(BuildReport report)
306306
{
307-
if (XRInteractionProjectValidation.LogBuildValidationIssues())
307+
if (XRInteractionProjectValidation.LogBuildValidationErrors())
308308
throw new BuildFailedException("Build Failed - XR Interaction Validation issue.");
309309
}
310310
}
311-
}
311+
}

0 commit comments

Comments
 (0)