HomeMgr.cs 893 B

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using JCUnityLib;
  5. /* Home场景管理者 */
  6. public class HomeMgr : MonoBehaviour
  7. {
  8. public static HomeMgr ins;
  9. void Awake()
  10. {
  11. ins = this;
  12. PersistenHandler.Init();
  13. ViewMgr.Instance.ShowView<TopBarView>();
  14. ViewMgr.Instance.ShowView<HomeView>();
  15. ViewMgr.Instance.ShowView<HomeFrameView>();
  16. Instantiate(SceneResourceManager.Instance.GetPrefab("DeviceBatteryView"));
  17. Instantiate(SceneResourceManager.Instance.GetPrefab("AuthLoginMask"));
  18. Instantiate(SceneResourceManager.Instance.GetPrefab("RenderBowCamera"));
  19. Instantiate(SceneResourceManager.Instance.GetPrefab("NewUserGuiderManager"));
  20. }
  21. void Start()
  22. {
  23. UserPlayer.ConnectServer();
  24. }
  25. void OnDestroy()
  26. {
  27. if (ins == this) ins = null;
  28. }
  29. }