VuforiaLocation.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  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. // Use this for initialization
  14. void Start () {
  15. StartCoroutine(InitARCamera());
  16. }
  17. IEnumerator InitARCamera() {
  18. while (true) {
  19. if (SvrManager.Instance.IsRunning) {
  20. transform.SetParent(SvrManager.Instance.head,false);
  21. transform.localPosition = new Vector3(RGBPositionOffsetX, RGBPositionOffsetY, RGBPositionOffsetZ);
  22. transform.localEulerAngles = new Vector3(RGBRotationOffsetX, RGBRotationOffsetY, RGBRotationOffsetZ);
  23. yield break;
  24. }
  25. yield return null;
  26. }
  27. }
  28. // Update is called once per frame
  29. void Update () {
  30. //gameObject.transform.position = SvrManager.Instance.modifyPosition;
  31. //gameObject.transform.rotation = SvrManager.Instance.modifyOrientation;
  32. }
  33. }
  34. }