OvrUIPen.cs 779 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using UnityEngine;
  3. public class OvrUIPen : MonoBehaviour
  4. {
  5. private void Awake()
  6. {
  7. this.m_trParent = base.transform.parent;
  8. this.m_vParentBackPos = this.m_trParent.localPosition;
  9. }
  10. private void OnEnable()
  11. {
  12. if (OvrIK.IsModeVRIK)
  13. {
  14. if (this.m_ctrl != null)
  15. {
  16. if (this.m_ctrl.m_bHandL)
  17. {
  18. this.m_trParent.localPosition = new Vector3(0.0298f, -0.036f, this.m_trParent.localPosition.z);
  19. }
  20. else
  21. {
  22. this.m_trParent.localPosition = new Vector3(-0.0326f, this.m_trParent.localPosition.y, this.m_trParent.localPosition.z);
  23. }
  24. }
  25. }
  26. else
  27. {
  28. this.m_trParent.localPosition = this.m_vParentBackPos;
  29. }
  30. }
  31. public AVRControllerBehavior m_ctrl;
  32. private Transform m_trParent;
  33. private Vector3 m_vParentBackPos;
  34. }