LogoSenceMgr.cs 605 B

1234567891011121314151617181920212223242526
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5. public class LogoSenceMgr : MonoBehaviour
  6. {
  7. public GameObject go;
  8. public float time;
  9. AsyncOperation async;
  10. private void OnEnable()
  11. {
  12. Invoke("LoadSence", 3);
  13. }
  14. public void LoadSence()
  15. {
  16. go.SetActive(true);
  17. Invoke("LoadLoginSence", time);
  18. async = SceneManager.LoadSceneAsync("Login");
  19. async.allowSceneActivation = false;
  20. }
  21. public void LoadLoginSence()
  22. {
  23. async.allowSceneActivation = true;
  24. }
  25. }