DianYunManager.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Immersal.AR;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using XRTool.Util;
  6. using static XunJianDataManager;
  7. public class DianYunManager : MonoSingleton<DianYunManager>
  8. {
  9. public GameObject SDK;
  10. public ARMap map;
  11. public ARSpace maps;
  12. public XRLocalizer xr;
  13. public GameObject TestGo;
  14. private void OnEnable()
  15. {
  16. }
  17. private void Update()
  18. {
  19. if(map)
  20. {
  21. TestGo.transform.position = map.transform.position;
  22. TestGo.transform.eulerAngles = map.transform.eulerAngles;
  23. }
  24. }
  25. public void stopSaoMiao()
  26. {
  27. if(SDK)
  28. {
  29. Destroy(SDK);
  30. map = null;
  31. SDK = null;
  32. maps = null;
  33. }
  34. }
  35. public void startSaoMiao()
  36. {
  37. if(TestGo==null)
  38. {
  39. TestGo = new GameObject();
  40. }
  41. SDK = GameObject.Instantiate(WindowsManager.Instance.GetPrefab(WindowConfig.windowType.XunJian, "SDK"));
  42. SDK.transform.parent = this.transform;
  43. SDK.transform.localPosition = Vector3.zero;
  44. SDK.transform.localEulerAngles = Vector3.zero;
  45. maps = SDK.GetComponentInChildren<ARSpace>();
  46. map = maps.GetComponentInChildren<ARMap>();
  47. }
  48. }