MainManager.cs 669 B

12345678910111213141516171819202122232425262728293031
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class MainManager : MonoBehaviour
  5. {
  6. #region 生成红外交互对象
  7. public GameObject spawnObj;
  8. #endregion
  9. // Start is called before the first frame update
  10. void Start()
  11. {
  12. spawnInfraredManager();
  13. }
  14. void spawnInfraredManager()
  15. {
  16. if (ScreenLocate.Main)
  17. {
  18. ScreenLocate.Main.mUIManagerSingle.showManager();
  19. return;
  20. }
  21. //初始化
  22. var infraredManager = GameObject.Instantiate(spawnObj);
  23. DontDestroyOnLoad(infraredManager);
  24. infraredManager.name = "WebCameraView";
  25. }
  26. }