Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The XR component is now compatible with IXIT v1.0.0-pre.1 TRNG-1271 #73

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

Gusinuhe
Copy link
Contributor

feat: component is compatible with older IXIT versions
feat: multiple interactables and interactors can now be edited at the same time

Description

Fixes: Incompatibility with the latest XR Interaction Toolkit version.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

Importing different versions of the XR Interaction Toolkit.

@SimonTheSourcerer
Copy link
Contributor

Seems like detach will be called when the snapzone is destroyed eg. on exiting playmode, which creates this lovley NPE:

NullReferenceException: Object reference not set to an instance of an object
Innoactive.Creator.XRInteraction.SnapZone.OnDetach (UnityEngine.XR.Interaction.Toolkit.XRBaseInteractable interactable) (at Assets/Innoactive/Creator/Components/XR-Interaction-Component/Runtime/Interaction/SnapZone.cs:240)
UnityEngine.Events.InvokableCall1[T1].Invoke (T1 args0) (at <ee47be73f7ef409ca5e5ce4b121745b7>:0) UnityEngine.Events.UnityEvent1[T0].Invoke (T0 arg0) (at :0)
UnityEngine.XR.Interaction.Toolkit.XRBaseInteractor.OnSelectExited (UnityEngine.XR.Interaction.Toolkit.XRBaseInteractable interactable) (at Library/PackageCache/com.unity.xr.interaction.toolkit@0.10.0-preview.7/Runtime/Interaction/Interactors/XRBaseInteractor.cs:462)
UnityEngine.XR.Interaction.Toolkit.XRInteractionManager.SelectCancel (UnityEngine.XR.Interaction.Toolkit.XRBaseInteractor interactor, UnityEngine.XR.Interaction.Toolkit.XRBaseInteractable interactable) (at Library/PackageCache/com.unity.xr.interaction.toolkit@0.10.0-preview.7/Runtime/Interaction/XRInteractionManager.cs:323)
UnityEngine.XR.Interaction.Toolkit.XRInteractionManager.UnregisterInteractor (UnityEngine.XR.Interaction.Toolkit.XRBaseInteractor interactor) (at Library/PackageCache/com.unity.xr.interaction.toolkit@0.10.0-preview.7/Runtime/Interaction/XRInteractionManager.cs:170)
UnityEngine.XR.Interaction.Toolkit.XRBaseInteractor.OnDestroy () (at Library/PackageCache/com.unity.xr.interaction.toolkit@0.10.0-preview.7/Runtime/Interaction/Interactors/XRBaseInteractor.cs:244)

@Gusinuhe Gusinuhe changed the title feat: component is now compatible with IXIT v0.10.0-preview feat: component is now compatible with IXIT v0.10.0-preview TRNG-1271 Nov 19, 2020
@@ -7,28 +7,29 @@ namespace Innoactive.CreatorEditor.XRInteraction
/// <summary>
/// Drawer class for <see cref="SnapZone"/>.
/// </summary>
[CustomEditor(typeof(SnapZone))]
[CustomEditor(typeof(SnapZone)), CanEditMultipleObjects]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 should see if we can use this more often cause I stumbled upon this problem with other components too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Older XRIT versions did not support it, not sure because they forgot, they didn't want people to do it, or there was a logical reason but in the end, we just stick to their practices, since now they allow it natively, I guess it is safe for us too.

Runtime/Interaction/DirectInteractor.cs Outdated Show resolved Hide resolved
@Gusinuhe Gusinuhe marked this pull request as ready for review November 24, 2020 12:37
@Gusinuhe Gusinuhe force-pushed the hotfix/xr-interaction-toolkit-compatibility branch from 7da9060 to 64b01fc Compare November 24, 2020 13:00
@Gusinuhe Gusinuhe requested a review from tomwim November 24, 2020 13:01
@Gusinuhe Gusinuhe changed the title feat: component is now compatible with IXIT v0.10.0-preview TRNG-1271 The XR component is now compatible with IXIT v1.0.0-pre.1 TRNG-1271 Nov 24, 2020
Copy link
Contributor

@Maxsiom Maxsiom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested:

  • Upgrading old project from 0.9.4 to 0.10.0 ✔️
  • Warning tested (set to new system, old system, and both) ✔️
  • Created new training course with different snap zones (multi meshes, single meshes, ...) ✔️

Bugs when enabling the Interactable Highlighter on a cube object with 3 children: 🔴
image

  • Mesh Renderer gets deactivated
  • Those errors are shown:
NullReferenceException: Cube has no renderers to be highlighted.
Innoactive.Creator.XRInteraction.InteractableHighlighter.RefreshCachedRenderers () (at Assets/Innoactive/Creator/Components/XR-Interaction-Component/Runtime/Interaction/Highlighters/InteractableHighlighter.cs:392)
Innoactive.Creator.XRInteraction.InteractableHighlighter.ForceRefreshCachedRenderers () (at Assets/Innoactive/Creator/Components/XR-Interaction-Component/Runtime/Interaction/Highlighters/InteractableHighlighter.cs:365)
Innoactive.CreatorEditor.XRInteraction.InteractableHighlighterEditor.OnEnable () (at Assets/Innoactive/Creator/Components/XR-Interaction-Component/Editor/Interaction/InteractableHighlighterEditor.cs:78)


NullReferenceException: Object reference not set to an instance of an object
Innoactive.CreatorEditor.XRInteraction.InteractableHighlighterEditor.DrawTouchHighlightSection (Innoactive.CreatorEditor.XRInteraction.InteractableHighlighterEditor+HighlightCase highlightCase) (at Assets/Innoactive/Creator/Components/XR-Interaction-Component/Editor/Interaction/InteractableHighlighterEditor.cs:102)
Innoactive.CreatorEditor.XRInteraction.InteractableHighlighterEditor.OnInspectorGUI () (at Assets/Innoactive/Creator/Components/XR-Interaction-Component/Editor/Interaction/InteractableHighlighterEditor.cs:93)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <bccb16a88ec4456dbf07978c418f407b>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

@Maxsiom
Copy link
Contributor

Maxsiom commented Nov 25, 2020

This bug also happens with a simple game object (e.g. cube or sphere) alone. Just try to enable the Interactable Highlighter.

@Gusinuhe
Copy link
Contributor Author

This bug also happens with a simple game object (e.g. cube or sphere) alone. Just try to enable the Interactable Highlighter.

It should be fixed now.

Maxsiom
Maxsiom previously approved these changes Nov 27, 2020
tomwim
tomwim previously approved these changes Nov 27, 2020
@Gusinuhe Gusinuhe dismissed stale reviews from tomwim and Maxsiom via 1dd5040 November 27, 2020 12:28
Maxsiom
Maxsiom previously approved these changes Nov 27, 2020
feat: multiple interactables and interactors can now be edited at the same time
feat: material support for URP and PSB
fix: snap zones can be generated in groups
@Gusinuhe Gusinuhe merged commit 329e13c into develop Nov 30, 2020
@Gusinuhe Gusinuhe deleted the hotfix/xr-interaction-toolkit-compatibility branch November 30, 2020 13:04
@ci-innoactive
Copy link
Collaborator

🎉 This PR is included in version 1.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants