| 123456789101112131415161718192021222324252627282930313233343536 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace InfraredDLLManager
- {
- /// <summary>
- /// 生成ui入口
- /// </summary>
- 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";
- }
- }
-
- }
- }
|