From 9dbe6dedde31537a400853ddf4ff331d34519370 Mon Sep 17 00:00:00 2001 From: Felix Johannes Thiel Date: Tue, 4 Jul 2023 13:54:31 +0100 Subject: [PATCH] Added public method to UbiqAvatarHintsHelper to allow for a reset of the hint providers. This is useful when hints become invalid e.g. due to a scene change or the player rig being unavailable at start. --- .../Runtime/Avatars/UbiqAvatarHintsHelper.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Unity/Assets/Runtime/Avatars/UbiqAvatarHintsHelper.cs b/Unity/Assets/Runtime/Avatars/UbiqAvatarHintsHelper.cs index b809c843b..04d2e656e 100644 --- a/Unity/Assets/Runtime/Avatars/UbiqAvatarHintsHelper.cs +++ b/Unity/Assets/Runtime/Avatars/UbiqAvatarHintsHelper.cs @@ -22,6 +22,14 @@ public class UbiqAvatarHintsHelper : MonoBehaviour [SerializeField] private string rightGripNode = "RightGrip"; private void Start() + { + SetAllProviders(); + } + + /// + /// Private method to set all providers for the Ubiq Avatar Hints + /// + private void SetAllProviders() { var pcs = FindObjectsOfType(includeInactive:true); @@ -51,6 +59,15 @@ private void Start() SetGripProvider(rightGripNode,rightHc); } + /// + /// 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. + /// + public void ResetAllProviders() + { + SetAllProviders(); + } + private void GetLeftHand(HandController[] handControllers, out Transform hand, out Transform wrist, out HandController handController) {