StoryE10P1.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections;
  3. using DG.Tweening;
  4. using I2.Loc;
  5. using UnityEngine;
  6. public class StoryE10P1 : BaseBehaviour
  7. {
  8. private void Start()
  9. {
  10. this.first = true;
  11. this.gate1.openType = SceneGate.OpenType.None;
  12. this.gate2.openType = SceneGate.OpenType.None;
  13. this.text.text = ScriptLocalization.Story.e10s1;
  14. this.text.transform.DOScale(Vector3.one, 3f).SetLoops(-1);
  15. DOTween.ToAlpha(() => this.text.color, delegate(Color c)
  16. {
  17. this.text.color = c;
  18. }, 0f, 3f).SetLoops(-1);
  19. }
  20. public void OnTriggerEnter2D(Collider2D other)
  21. {
  22. if (other.CompareTag("Player") && this.first)
  23. {
  24. this.first = false;
  25. base.StartCoroutine(this.MainCoroutine());
  26. }
  27. }
  28. private IEnumerator MainCoroutine()
  29. {
  30. YieldInstruction t = R.Audio.PlayVoiceOver("e10t1", null, false);
  31. R.Audio.PlayEffect(369, new Vector3?(R.Player.Transform.position));
  32. yield return t;
  33. this.gate2.openType = SceneGate.OpenType.Left;
  34. yield break;
  35. }
  36. [SerializeField]
  37. private SceneGate gate1;
  38. [SerializeField]
  39. private SceneGate gate2;
  40. [SerializeField]
  41. private TextMesh text;
  42. private bool first;
  43. }