123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using SC.XR.Unity.Module_ShadowSystem;
- public class VuforiaLocation : MonoBehaviour {
- public Vector3 RGBPositionOffset = new Vector3(0,0f,0.05f);
- public Vector3 RGBRotationOffset;
- // Use this for initialization
- void Start() {
- StartCoroutine(InitARCamera());
-
- }
- IEnumerator InitARCamera() {
- while(true) {
- if(SvrManager.Instance.IsRunning) {
- transform.SetParent(SvrManager.Instance.head, false);
- if(Module_ShadowSystem.Instant != null) {
- if(Module_ShadowSystem.Instant.Device) {
- transform.localEulerAngles = -Module_ShadowSystem.Instant.Device.Current.RGBRotationOffset + RGBRotationOffset;
- transform.localPosition = -Module_ShadowSystem.Instant.Device.Current.RGBPositionOffset + RGBPositionOffset;
- } else {
- transform.localEulerAngles = RGBRotationOffset;
- transform.localPosition = RGBPositionOffset;
- }
- }
-
- yield break;
- }
- yield return null;
- }
- }
- // Update is called once per frame
- void Update() {
- //gameObject.transform.position = SvrManager.Instance.modifyPosition;
- //gameObject.transform.rotation = SvrManager.Instance.modifyOrientation;
- }
- }
|