| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using AppUI.Manager.View;
- using UnityEngine;
- using UIViewMgr = AppUI.Manager.ViewMgr;
- namespace AppUI.View.Home.Main
- {
- public class HomeMgr : MonoBehaviour
- {
- void Awake()
- {
- PersistenHandler.Init();
- // 初始化 ViewMgr 根节点与分组 0、1(仅需调用一次)
- UIViewMgr.EnsureInitialized();
- ViewManager.ShowView(UIViewType.HomeView);
- Instantiate(ViewManager.GetPrefabByType(UIPrefabType.AuthLoginMask));
- //Instantiate(SceneResourceManager.Instance.GetPrefab("DeviceBatteryView"));
- //Instantiate(SceneResourceManager.Instance.GetPrefab("NewUserGuiderManager"));
- InfraredDemo.Create();
- if (CommonConfig.StandaloneModeOrPlatformB)
- DevicesHolder.Init();
- }
- void Start()
- {
- Time.timeScale = 1;
- if (CommonConfig.StandaloneMode)
- {
- DoTweenUtil.CallDelay(0.1f, () => new UserPlayer());
- if (CommonConfig.StandaloneModeOrPlatformB)
- StandaloneAPI.InitTimeCounter();
- }
- else
- UserPlayer.ConnectServer();
- }
- void OnDestroy()
- {
- if (UIViewMgr.HasInstance())
- ViewManager.HideAllView();
- }
- }
- }
|