1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace ShadowKit.Action.Vuforia
- {
- public class VuforiaLocation : MonoBehaviour {
- public float RGBPositionOffsetX = 0f;
- public float RGBPositionOffsetY = 0.07f;
- public float RGBPositionOffsetZ = -0.03f;
- public float RGBRotationOffsetX = -8f;
- public float RGBRotationOffsetY = 0;
- public float RGBRotationOffsetZ = 0;
- private void Awake()
- {
- if (CheckDeviceType.checkIsPhone())
- {
- Destroy(this.gameObject);
- }
- }
- // Use this for initialization
- void Start () {
- StartCoroutine(InitARCamera());
- }
- IEnumerator InitARCamera() {
- while (true) {
- if (true) {
- transform.SetParent(OpenXRCamera.Instance.head,false);
- transform.localPosition = new Vector3(RGBPositionOffsetX, RGBPositionOffsetY, RGBPositionOffsetZ);
- transform.localEulerAngles = new Vector3(RGBRotationOffsetX, RGBRotationOffsetY, RGBRotationOffsetZ);
- yield break;
- }
- yield return null;
- }
- }
- // Update is called once per frame
- void Update () {
- //gameObject.transform.position = OpenXRCamera.Instance.modifyPosition;
- //gameObject.transform.rotation = OpenXRCamera.Instance.modifyOrientation;
- }
- }
- }
|