AppLauncher.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using Mono;
  4. using Mono.UI.Core;
  5. using UnityEngine;
  6. public class AppLauncher : MonoBehaviour
  7. {
  8. private bool _isStart;
  9. void Start()
  10. {
  11. GameObject prefab = Resources.Load<GameObject>("Canvas");
  12. GameObject _gameObject = GameObject.Instantiate(prefab);
  13. UIManager.Instance.SetUIRoot(_gameObject);
  14. ConfigComponent.Instance.Preload();
  15. _isStart = true;
  16. _timer = 0;
  17. TimeComponent.Instance.AddTimer(15, () => { UIManager.Instance.LoadAndOpenPanel<StartPanel>(UIManager.UILayer.Middle); });
  18. }
  19. private float _timer;
  20. // Update is called once per frame
  21. // void Update()
  22. // {
  23. // if (_isStart)
  24. // {
  25. // _timer += Time.deltaTime;
  26. // if (_timer >= 15)
  27. // {
  28. // UIManager.Instance.LoadAndOpenPanel<StartPanel>(UIManager.UILayer.Middle);
  29. // _isStart = false;
  30. // _timer = 0;
  31. // }
  32. // }
  33. // }
  34. }