GetObjectSystem.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. using Blue;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. namespace GHZLangChao
  5. {
  6. public class GetObjectSystem : SingletonMonobehaviour<GetObjectSystem>
  7. {
  8. [SerializeField] private GameObject ShowDevice;
  9. [SerializeField] private Transform Xunjian;
  10. private void Start()
  11. {
  12. GetObj();
  13. PushIOC();
  14. }
  15. private void GetObj()
  16. {
  17. Xunjian = new GameObject("Dof").AddComponent<Image>().transform;
  18. Xunjian.gameObject.SetActive(false);
  19. Xunjian.SetParent(OpenXRCamera.Instance.head.GetChild(0));
  20. Xunjian.GetComponent<RectTransform>().localPosition = new Vector3(InstantiateSystem.Instance.BlueObject.ZeroDofPosX, InstantiateSystem.Instance.BlueObject.ZeroDofPosY, InstantiateSystem.Instance.BlueObject.ZeroDofPosZ);
  21. }
  22. private void PushIOC()
  23. {
  24. SceneIOCContainer.Instance.Push("ShowDevice", ShowDevice);
  25. SceneIOCContainer.Instance.Push("Dof", Xunjian);
  26. }
  27. }
  28. }