GetObjectSystem.cs 1.0 KB

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