Skip to content

Commit

Permalink
Merge pull request #36 from realitycollective/feature/input-rig-support
Browse files Browse the repository at this point in the history
  • Loading branch information
FejZa authored Jul 25, 2024
2 parents 64f65ff + 99d42a9 commit 71c3614
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion Runtime/Rigs/PlayerRig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using RealityCollective.ServiceFramework.Services;
using RealityCollective.Utilities.Extensions;
using RealityToolkit.Input.Interfaces;
using UnityEngine;

namespace RealityToolkit.Player.Rigs
Expand All @@ -13,7 +14,7 @@ namespace RealityToolkit.Player.Rigs
[SelectionBase]
[DisallowMultipleComponent]
[System.Runtime.InteropServices.Guid("8E0EE4FC-C8A5-4B10-9FCA-EE55B6D421FF")]
public class PlayerRig : MonoBehaviour, IPlayerRig
public class PlayerRig : MonoBehaviour, IPlayerRig, IInputRig
{
[SerializeField, Tooltip("The camera component on the rig.")]
private Camera rigCamera = null;
Expand Down Expand Up @@ -43,6 +44,11 @@ protected virtual async void Start()
{
RigTransform.gameObject.DontDestroyOnLoad();
}

if (ServiceManager.Instance.TryGetService<IInputService>(out var inputService))
{
inputService.InputRig = this;
}
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Runtime/UX/PlayerFootstepSFX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace RealityToolkit.Player.UX
/// Produces a footstep sound effect when the player rig moves.
/// Attach to the <see cref="IPlayerRig"/> <see cref="GameObject"/>.
/// </summary>
[HelpURL("https://www.realitytoolkit.io/docs/category/player")]
[HelpURL(RealityToolkitRuntimePreferences.Toolkit_Docs_BaseUrl + "docs/category/player")]
[RequireComponent(typeof(IPlayerRig))]
public class PlayerFootstepSFX : MonoBehaviour
#if RTK_LOCOMOTION
Expand Down
2 changes: 1 addition & 1 deletion Runtime/UX/PlayerTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace RealityToolkit.Player.UX
/// <summary>
/// A simple utility component that will raise events as the player enters, leaves or stays within a trigger zone.
/// </summary>
[HelpURL("https://www.realitytoolkit.io/docs/category/player")]
[HelpURL(RealityToolkitRuntimePreferences.Toolkit_Docs_BaseUrl + "docs/category/player")]
[RequireComponent(typeof(Collider))]
public class PlayerTrigger : MonoBehaviour
{
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"url": "https://github.com/realitycollective"
},
"dependencies": {
"com.realitytoolkit.core": "1.0.0-pre.56",
"com.realitytoolkit.core": "1.0.0-pre.70",
"com.unity.xr.legacyinputhelpers": "2.1.7"
},
"assets": [
Expand All @@ -37,4 +37,4 @@
"path": "Assets~/"
}
]
}
}

0 comments on commit 71c3614

Please sign in to comment.