Skip to content

Commit

Permalink
#733 UMA dependent component removed from VRIKActions.cs. Replaced ol…
Browse files Browse the repository at this point in the history
…d UMA HandBone String with new CC4 HandBone String in VRAvatarAimingSystem.cs
  • Loading branch information
Yvo02 committed Jul 31, 2024
1 parent 5b42800 commit d561420
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
6 changes: 4 additions & 2 deletions Assets/SEE/Game/Avatars/VRAvatarAimingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal class VRAvatarAimingSystem : MonoBehaviour

///<summary>
/// The bone of the hand that is used to point.
/// </summary>
/// </summary>
private Transform HandBone;

/// <summary>
Expand Down Expand Up @@ -63,7 +63,9 @@ private void Awake()
Laser.On = true;
if (HandBone == null)
{
HandBone = gameObject.transform.Find("Root/Global/Position/Hips/LowerBack/Spine/Spine1/RightShoulder/RightArm/RightForeArm/RightHand")?.transform;
HandBone = gameObject.transform.Find(
"CC_Base_BoneRoot/CC_Base_Hip/CC_Base_Waist/CC_Base_Spine01/CC_Base_Spine02/CC_Base_R_Clavicle/CC_Base_R_Upperarm/CC_Base_R_Forearm/CC_Base_R_Hand")?.transform;
//HandBone = gameObject.transform.Find("Root/Global/Position/Hips/LowerBack/Spine/Spine1/RightShoulder/RightArm/RightForeArm/RightHand")?.transform;
}
if (HandBone == null)
{
Expand Down
26 changes: 9 additions & 17 deletions Assets/SEE/Game/Avatars/VRIKActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,24 +209,16 @@ public static void TurnOffAvatarAimingSystem(GameObject gameObject)
/// <param name="animatorForVrik">The to be replaced Animator</param>
public static void ReplaceAnimator(GameObject gameObject, string animatorForVrik)
{
if (gameObject.TryGetComponentOrLog(out DynamicCharacterAvatar avatar))
{
RuntimeAnimatorController animationController =
Resources.Load<RuntimeAnimatorController>(animatorForVrik);
if (animationController != null)
{
avatar.raceAnimationControllers.defaultAnimationController = animationController;
RuntimeAnimatorController animationController = Resources.Load<RuntimeAnimatorController>(animatorForVrik);

if (gameObject.TryGetComponentOrLog(out Animator animator))
{
animator.runtimeAnimatorController = animationController;
Debug.Log($"Loaded animation controller {animator.name} is human: {animator.isHuman}\n");
}
}
else
{
Debug.LogError($"Could not load the animation controller at '{animatorForVrik}.'\n");
}
if (gameObject.TryGetComponentOrLog(out Animator animator))
{
animator.runtimeAnimatorController = animationController;
Debug.Log($"Loaded animation controller {animator.name} is human: {animator.isHuman}\n");
}
else
{
Debug.LogError($"Could not load the animation controller at '{animatorForVrik}.'\n");
}
}
}
Expand Down

0 comments on commit d561420

Please sign in to comment.