| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using UnityEngine.Events;
- using System.Threading.Tasks;
- using System;
- public class PatchNotes : OffAnimation
- {
- [SerializeField] Animator _anim;
- [SerializeField] Text _verText;
- [SerializeField] LocalizeTMPro _localizeTMPro;
- [SerializeField][TextArea] string _text_ENG;
- [SerializeField][TextArea] string _text_JPN;
- [SerializeField] ScrollRect _scroll;
- bool _isOpen = false;
- public void OnClickOpenPatchNotesPanelButton()
- {
- if (_isOpen)
- {
- ClosePatchNotesPanel();
- }
- else
- {
- if (Opening.instance != null)
- {
- Opening.instance.PlayDecisionSE();
- }
- else if (GManager.instance != null)
- {
- GManager.instance.PlayDecisionSE();
- }
- ContinuousController.instance.StartCoroutine(Open());
- }
- }
- public IEnumerator Open()
- {
- _verText.text = $"Patch Notes ver{ContinuousController.instance.GameVerString}";
- _isOpen = true;
- gameObject.SetActive(true);
- _anim.SetInteger("Open", 1);
- _anim.SetInteger("Close", 0);
- _scroll.gameObject.SetActive(false);
- yield return new WaitForSeconds(0.25f);
- _scroll.gameObject.SetActive(true);
- _scroll.verticalNormalizedPosition = 1;
- _scroll.content.GetComponent<ContentSizeFitter>().SetLayoutVertical();
- }
- public void Close()
- {
- Close_(true);
- }
- public void ClosePatchNotesPanel()
- {
- _isOpen = false;
- bool playSE = false;
- if (gameObject.activeSelf)
- {
- playSE = true;
- }
- Close_(playSE);
- }
- public void Close_(bool playSE)
- {
- if (playSE)
- {
- if (Opening.instance != null)
- {
- Opening.instance.PlayCancelSE();
- }
- else if (GManager.instance != null)
- {
- GManager.instance.PlayCancelSE();
- }
- }
- _anim.SetInteger("Open", 0);
- _anim.SetInteger("Close", 1);
- }
- public void Init()
- {
- if (_localizeTMPro != null)
- {
- _localizeTMPro._text_ENG = _text_ENG;
- _localizeTMPro._text_JPN = _text_JPN;
- }
- Off();
- }
- }
|