GetObjectSystem.cs 929 B

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 Xunjian2;
  10. private void Awake()
  11. {
  12. GetObj();
  13. PushIOC();
  14. }
  15. private void GetObj()
  16. {
  17. Xunjian2 = new GameObject("Dof").AddComponent<Image>().transform;
  18. Xunjian2.gameObject.SetActive(false);
  19. Xunjian2.SetParent(OpenXRCamera.Instance.head.GetChild(0));
  20. Xunjian2.GetComponent<RectTransform>().localPosition = new Vector3(50, 0, 180);
  21. }
  22. private void PushIOC()
  23. {
  24. SceneIOCContainer.Instance.Push("ShowDevice", ShowDevice);
  25. SceneIOCContainer.Instance.Push("Dof", Xunjian2);
  26. }
  27. }
  28. }