StoryE23P1.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. using System.Collections;
  3. using UnityEngine;
  4. public class StoryE23P1 : BaseBehaviour
  5. {
  6. private void Start()
  7. {
  8. bool flag = R.Player.Transform.position.x < base.transform.position.x;
  9. if (flag)
  10. {
  11. base.StartCoroutine(this.Sequence0());
  12. }
  13. else
  14. {
  15. this._doorCollider.SetActive(true);
  16. }
  17. }
  18. private void OnDestroy()
  19. {
  20. if (!SingletonMono<UIController>.ApplicationIsQuitting)
  21. {
  22. R.Ui.Tutorial.Hide(new int?(0));
  23. }
  24. }
  25. public IEnumerator Sequence0()
  26. {
  27. while (R.Player.ActionController == null)
  28. {
  29. yield return null;
  30. }
  31. this._outerDoor.state.SetAnimation(0, "CloseToOpen", false);
  32. this._door.state.SetAnimation(0, "CloseToOpen", false);
  33. R.Player.ActionController.ChangeState(PlayerAction.StateEnum.Idle);
  34. R.Player.ActionController.TurnRound(1);
  35. R.Player.ActionController.StartMove();
  36. InputSetting.Stop(false);
  37. yield return new WaitForSeconds(1.2f);
  38. R.Player.ActionController.StopMove();
  39. yield return new WaitForSeconds(0.3f);
  40. this._doorCollider.SetActive(true);
  41. this._outerDoor.state.SetAnimation(0, "OpenToClose", false);
  42. this._door.state.SetAnimation(0, "OpenToClose", false);
  43. yield return new WaitForSeconds(1f);
  44. if (!InputSetting.IsWorking())
  45. {
  46. InputSetting.Resume(false);
  47. }
  48. R.Ui.Tutorial.Show(0);
  49. yield return new WaitForSeconds(10f);
  50. R.Ui.Tutorial.Hide(new int?(0));
  51. yield break;
  52. }
  53. [SerializeField]
  54. private SkeletonAnimation _door;
  55. [SerializeField]
  56. private SkeletonAnimation _outerDoor;
  57. [SerializeField]
  58. private GameObject _doorCollider;
  59. }