VuforiaLocation.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace ShadowKit.Action.Vuforia
  5. {
  6. public class VuforiaLocation : MonoBehaviour {
  7. public float RGBPositionOffsetX = 0f;
  8. public float RGBPositionOffsetY = 0.07f;
  9. public float RGBPositionOffsetZ = -0.03f;
  10. public float RGBRotationOffsetX = -8f;
  11. public float RGBRotationOffsetY = 0;
  12. public float RGBRotationOffsetZ = 0;
  13. private void Awake()
  14. {
  15. if (CheckDeviceType.checkIsPhone())
  16. {
  17. Destroy(this.gameObject);
  18. }
  19. }
  20. // Use this for initialization
  21. void Start () {
  22. StartCoroutine(InitARCamera());
  23. }
  24. IEnumerator InitARCamera() {
  25. while (true) {
  26. if (true) {
  27. transform.SetParent(OpenXRCamera.Instance.head,false);
  28. transform.localPosition = new Vector3(RGBPositionOffsetX, RGBPositionOffsetY, RGBPositionOffsetZ);
  29. transform.localEulerAngles = new Vector3(RGBRotationOffsetX, RGBRotationOffsetY, RGBRotationOffsetZ);
  30. yield break;
  31. }
  32. yield return null;
  33. }
  34. }
  35. // Update is called once per frame
  36. void Update () {
  37. //gameObject.transform.position = OpenXRCamera.Instance.modifyPosition;
  38. //gameObject.transform.rotation = OpenXRCamera.Instance.modifyOrientation;
  39. }
  40. }
  41. }