StoryE23P8.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Collections;
  3. using UnityEngine;
  4. public class StoryE23P8 : BaseBehaviour
  5. {
  6. private static bool IsFirstE23P8
  7. {
  8. get
  9. {
  10. return SaveStorage.Get("E23_p8", true);
  11. }
  12. set
  13. {
  14. SaveStorage.Set("E23_p8", value);
  15. }
  16. }
  17. private bool HasEnteredLevelSelectSystem
  18. {
  19. get
  20. {
  21. return SaveStorage.Get("HasEnteredLevelSelectSystem", false);
  22. }
  23. set
  24. {
  25. SaveStorage.Set("HasEnteredLevelSelectSystem", value);
  26. }
  27. }
  28. private void Update()
  29. {
  30. if (StoryE23P8.IsFirstE23P8 && Mathf.Abs(R.Player.Transform.position.x - base.transform.position.x) < 1f)
  31. {
  32. StoryE23P8.IsFirstE23P8 = false;
  33. UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
  34. base.StartCoroutine(this.Sequence0());
  35. }
  36. }
  37. private void OnDestroy()
  38. {
  39. if (!SingletonMono<UIController>.ApplicationIsQuitting)
  40. {
  41. R.Ui.Tutorial.Hide(new int?(7));
  42. }
  43. }
  44. private IEnumerator Sequence0()
  45. {
  46. this.HasEnteredLevelSelectSystem = true;
  47. yield return R.Ui.Tutorial.Show(7);
  48. yield return new WaitForSeconds(5f);
  49. UnityEngine.Object.Destroy(base.gameObject);
  50. yield break;
  51. }
  52. }