PatchNotes.cs 2.1 KB

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