You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

55 lines
1.2 KiB

  1. using System;
  2. using System.Collections;
  3. using CIG;
  4. using CIG.Translation;
  5. using UnityEngine;
  6. using UnityEngine.SceneManagement;
  7. public class SplashSparkling : MonoBehaviour
  8. {
  9. private void Start()
  10. {
  11. {
  12. this.LoadWelcomeScene();
  13. }
  14. }
  15. public void FinishedPlaying()
  16. {
  17. this._isSparklingSplashAnimationDone = true;
  18. }
  19. public void ConsentRequestCallback(string message)
  20. {
  21. if (message == "cancelled")
  22. {
  23. CIGApp.ForceQuit();
  24. }
  25. else
  26. {
  27. this.LoadWelcomeScene();
  28. }
  29. }
  30. private void LoadWelcomeScene()
  31. {
  32. base.StartCoroutine(this.DoLoadWelcomeSceneRoutine());
  33. }
  34. private IEnumerator DoLoadWelcomeSceneRoutine()
  35. {
  36. AsyncOperation loadOp = SceneManager.LoadSceneAsync("LoadingScreen");
  37. loadOp.allowSceneActivation = false;
  38. while (!this._isSparklingSplashAnimationDone)
  39. {
  40. yield return null;
  41. }
  42. loadOp.allowSceneActivation = true;
  43. yield break;
  44. }
  45. private const string WelcomeScene = "LoadingScreen";
  46. private bool _isSparklingSplashAnimationDone;
  47. }