Skip to content

Commit

Permalink
Merge pull request #34 from FJThiel/HintReset
Browse files Browse the repository at this point in the history
Hint Provider reset.
  • Loading branch information
bnco-dev authored Jul 24, 2023
2 parents fe6b604 + 9dbe6de commit 4f513ce
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Unity/Assets/Runtime/Avatars/UbiqAvatarHintsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ public class UbiqAvatarHintsHelper : MonoBehaviour
[SerializeField] private string rightGripNode = "RightGrip";

private void Start()
{
SetAllProviders();
}

/// <summary>
/// Private method to set all providers for the Ubiq Avatar Hints
/// </summary>
private void SetAllProviders()
{
var pcs = FindObjectsOfType<XRPlayerController>(includeInactive:true);

Expand Down Expand Up @@ -51,6 +59,15 @@ private void Start()
SetGripProvider(rightGripNode,rightHc);
}

/// <summary>
/// Public method to reset all providers for the Ubiq Avatar Hints.
/// Useful when hints become invalid e.g. due to a scene change or the player rig being unavailable at start.
/// </summary>
public void ResetAllProviders()
{
SetAllProviders();
}

private void GetLeftHand(HandController[] handControllers,
out Transform hand, out Transform wrist, out HandController handController)
{
Expand Down

0 comments on commit 4f513ce

Please sign in to comment.