StoryE13P1.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections;
  3. using UnityEngine;
  4. public class StoryE13P1 : BaseBehaviour
  5. {
  6. private void Start()
  7. {
  8. if (R.Player.Attribute.flashLevel == 3)
  9. {
  10. UnityEngine.Object.Destroy(base.gameObject);
  11. UnityEngine.Object.Destroy(this.supplyBox.gameObject);
  12. }
  13. }
  14. private void Update()
  15. {
  16. float num = Vector2.Distance(base.transform.position, R.Player.Transform.position);
  17. if (num < 4f && !this.show)
  18. {
  19. base.StartCoroutine(this.P1Coroutine());
  20. }
  21. }
  22. private IEnumerator P1Coroutine()
  23. {
  24. if (!this.show)
  25. {
  26. this.show = true;
  27. yield return R.Audio.PlayVoiceOver("e13t1", null, false);
  28. }
  29. yield return this.supplyBox.WaitForBreak();
  30. yield return new WaitForSeconds(2f);
  31. if (!InputSetting.IsWorking())
  32. {
  33. InputSetting.Resume(false);
  34. }
  35. R.Player.Attribute.flashLevel = 3;
  36. R.Player.Attribute.currentFlashTimes = R.Player.Attribute.flashTimes;
  37. R.Player.Attribute.FlashCd = 0;
  38. R.Ui.Flash.RecoverAll(R.Player.Attribute.flashTimes);
  39. YieldInstruction coroutine = R.Audio.PlayVoiceOver("e13t2", null, false);
  40. R.Mode.EnterMode(Mode.AllMode.Story);
  41. yield return R.Ui.Tutorial.PlayVideo("Movies/ps4", "flash3.mp4");
  42. R.Mode.ExitMode(Mode.AllMode.Story);
  43. yield return coroutine;
  44. yield break;
  45. }
  46. [SerializeField]
  47. private SupplyBoxAction supplyBox;
  48. private bool show;
  49. }