GetObjectSystem.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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. Debug.Log("CYSB ==> " + InstantiateSystem.Instance.BlueObject.ZeroDofPosZ);
  20. Xunjian.GetComponent<RectTransform>().localPosition = new Vector3(InstantiateSystem.Instance.BlueObject.ZeroDofPosX, InstantiateSystem.Instance.BlueObject.ZeroDofPosY, 130);
  21. }
  22. private void PushIOC()
  23. {
  24. SceneIOCContainer.Instance.Push("ShowDevice", ShowDevice);
  25. SceneIOCContainer.Instance.Push("Dof", Xunjian);
  26. }
  27. }
  28. }