AppLauncher.cs 855 B

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