PatchNotes.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using System.Collections;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. public class PatchNotes : OffAnimation
  5. {
  6. [SerializeField] Animator _anim;
  7. [SerializeField] Text _verText;
  8. [SerializeField] LocalizeTMPro _localizeTMPro;
  9. [SerializeField][TextArea] string _text_ENG;
  10. [SerializeField][TextArea] string _text_JPN;
  11. [SerializeField] ScrollRect _scroll;
  12. public void ReportBug()
  13. {
  14. Application.OpenURL("https://forms.gle/GhZgGVJS1qLeUMcG8");
  15. }
  16. public void OpenPatchNotes()
  17. {
  18. Application.OpenURL("https://dcgo.online/PatchNotes.html");
  19. }
  20. public IEnumerator Open()
  21. {
  22. _verText.text = $"Patch Notes ver{ContinuousController.instance.GameVerString}";
  23. gameObject.SetActive(true);
  24. _anim.SetInteger("Open", 1);
  25. _anim.SetInteger("Close", 0);
  26. _scroll.gameObject.SetActive(false);
  27. yield return new WaitForSeconds(0.25f);
  28. _scroll.gameObject.SetActive(true);
  29. _scroll.verticalNormalizedPosition = 1;
  30. _scroll.content.GetComponent<ContentSizeFitter>().SetLayoutVertical();
  31. }
  32. public void Close()
  33. {
  34. Close_(true);
  35. }
  36. public void ClosePatchNotesPanel()
  37. {
  38. bool playSE = false;
  39. if (gameObject.activeSelf)
  40. {
  41. playSE = true;
  42. }
  43. Close_(playSE);
  44. }
  45. public void Close_(bool playSE)
  46. {
  47. if (playSE)
  48. {
  49. if (Opening.instance != null)
  50. {
  51. Opening.instance.PlayCancelSE();
  52. }
  53. else if (GManager.instance != null)
  54. {
  55. GManager.instance.PlayCancelSE();
  56. }
  57. }
  58. _anim.SetInteger("Open", 0);
  59. _anim.SetInteger("Close", 1);
  60. }
  61. public void Init()
  62. {
  63. if (_localizeTMPro != null)
  64. {
  65. _localizeTMPro._text_ENG = _text_ENG;
  66. _localizeTMPro._text_JPN = _text_JPN;
  67. }
  68. Off();
  69. }
  70. }