using System.Collections; using System.Collections.Generic; using UnityEngine; namespace InfraredDLLManager { /// /// 生成ui入口 /// public class MainManager : MonoBehaviour { #region 生成红外交互对象 public GameObject spawnObj; #endregion // Start is called before the first frame update void Awake() { UIManager uIManager = UIManager.GetInstance(); // 确保对象被正确创建 if (uIManager != null) { uIManager.showManager(); // 执行管理功能 } else { //初始化 var infraredManager = GameObject.Instantiate(spawnObj); DontDestroyOnLoad(infraredManager); infraredManager.name = "InfraredView"; } } } }