1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using Immersal.AR;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using XRTool.Util;
- using static XunJianDataManager;
- public class DianYunManager : MonoSingleton<DianYunManager>
- {
- public GameObject SDK;
- public ARMap map;
- public ARSpace maps;
- public XRLocalizer xr;
- public GameObject TestGo;
- private void OnEnable()
- {
- }
- private void Update()
- {
- if(map)
- {
- TestGo.transform.position = map.transform.position;
- TestGo.transform.eulerAngles = map.transform.eulerAngles;
- }
- }
- public void stopSaoMiao()
- {
- if(SDK)
- {
- Destroy(SDK);
- map = null;
- SDK = null;
- maps = null;
- }
- }
- public void startSaoMiao()
- {
- if(TestGo==null)
- {
- TestGo = new GameObject();
- }
- SDK = GameObject.Instantiate(WindowsManager.Instance.GetPrefab(WindowConfig.windowType.XunJian, "SDK"));
- SDK.transform.parent = this.transform;
- SDK.transform.localPosition = Vector3.zero;
- SDK.transform.localEulerAngles = Vector3.zero;
- maps = SDK.GetComponentInChildren<ARSpace>();
- map = maps.GetComponentInChildren<ARMap>();
- }
- }
|