PatchNotes.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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("http://dcgo.online/");
  20. /*if (_isOpen)
  21. {
  22. ClosePatchNotesPanel();
  23. }
  24. else
  25. {
  26. if (Opening.instance != null)
  27. {
  28. Opening.instance.PlayDecisionSE();
  29. }
  30. else if (GManager.instance != null)
  31. {
  32. GManager.instance.PlayDecisionSE();
  33. }
  34. ContinuousController.instance.StartCoroutine(Open());
  35. }*/
  36. }
  37. public IEnumerator Open()
  38. {
  39. _verText.text = $"Patch Notes ver{ContinuousController.instance.GameVerString}";
  40. _isOpen = true;
  41. gameObject.SetActive(true);
  42. _anim.SetInteger("Open", 1);
  43. _anim.SetInteger("Close", 0);
  44. _scroll.gameObject.SetActive(false);
  45. yield return new WaitForSeconds(0.25f);
  46. _scroll.gameObject.SetActive(true);
  47. _scroll.verticalNormalizedPosition = 1;
  48. _scroll.content.GetComponent<ContentSizeFitter>().SetLayoutVertical();
  49. }
  50. public void Close()
  51. {
  52. Close_(true);
  53. }
  54. public void ClosePatchNotesPanel()
  55. {
  56. _isOpen = false;
  57. bool playSE = false;
  58. if (gameObject.activeSelf)
  59. {
  60. playSE = true;
  61. }
  62. Close_(playSE);
  63. }
  64. public void Close_(bool playSE)
  65. {
  66. if (playSE)
  67. {
  68. if (Opening.instance != null)
  69. {
  70. Opening.instance.PlayCancelSE();
  71. }
  72. else if (GManager.instance != null)
  73. {
  74. GManager.instance.PlayCancelSE();
  75. }
  76. }
  77. _anim.SetInteger("Open", 0);
  78. _anim.SetInteger("Close", 1);
  79. }
  80. public void Init()
  81. {
  82. if (_localizeTMPro != null)
  83. {
  84. _localizeTMPro._text_ENG = _text_ENG;
  85. _localizeTMPro._text_JPN = _text_JPN;
  86. }
  87. Off();
  88. }
  89. }