SkinSwitcher.cs 975 B

12345678910111213141516171819202122232425262728
  1. // /******************************************************************************
  2. // * File: SkinSwitcher.cs
  3. // * Copyright (c) 2023 Qualcomm Technologies, Inc. and/or its subsidiaries. All rights reserved.
  4. // *
  5. // *
  6. // ******************************************************************************/
  7. using QCHT.Interactions.Core;
  8. using QCHT.Interactions.Hands;
  9. using UnityEngine;
  10. namespace QCHT.Samples.Menu
  11. {
  12. public class SkinSwitcher : MonoBehaviour
  13. {
  14. [SerializeField] private XRHandTrackingManager _hatManager;
  15. public void SetLeftSkin(HandSkin skin) {
  16. _hatManager = _hatManager ? _hatManager : FindObjectOfType<XRHandTrackingManager>();
  17. _hatManager.SetLeftHandSkin(skin);
  18. }
  19. public void SetRightSkin(HandSkin skin) {
  20. _hatManager = _hatManager ? _hatManager : FindObjectOfType<XRHandTrackingManager>();
  21. _hatManager.SetRightHandSkin(skin);
  22. }
  23. }
  24. }