using System.Collections.Generic; using Blue; using UnityEngine; using TMPro; public class InstantiateSystem : SingletonMonobehaviour { [SerializeField] private BlueObject blueObject; public BlueObject BlueObject => blueObject; public Dictionary objDic = new Dictionary(); public void InstantiatePrefab(GameObject prefab,GameObject parent =null) { Instantiate(prefab,parent.transform); } public void InstantiatePrefab(GameObject prefab, string content = "") { if (content != "") { // 修改显示内容,并实例化到CenterCamera prefab.GetComponentInChildren().text = content; /* GameObject CenterCamera = GameObject.Find("SDKSystem/NRCameraRig/CenterCamera"); if(CenterCamera!=null) Instantiate(prefab, CenterCamera.transform); */ if (OpenXRCamera.Instance.head != null) Instantiate(prefab, OpenXRCamera.Instance.head); // 关闭加载界面 if (objDic.TryGetValue("LoadingPanel(Clone)",out GameObject LoadingPanel)) { if (LoadingPanel.activeSelf) LoadingPanel.SetActive(false); } } else Instantiate(prefab); } }