71 lines
1.4 KiB
C#
71 lines
1.4 KiB
C#
using DG.Tweening;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using static Aspose.Pdf.Operator;
|
|
|
|
public class UI_FadePanel : BasePanel
|
|
{
|
|
public static UI_FadePanel Instance;
|
|
public string FadeString;
|
|
|
|
public Image FadeBg;
|
|
/// <summary>
|
|
/// Îı¾
|
|
/// </summary>
|
|
public TextMeshProUGUI FadetextMeshProUGUI;
|
|
public float typeTime;
|
|
|
|
|
|
public Button Next_Btn;
|
|
|
|
//public Button Next_Btn;
|
|
public void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
|
|
public void Init()
|
|
{
|
|
gameObject.SetActive(true);
|
|
FadeBg.DOFade(1,1f);
|
|
StartCoroutine(Typing(FadetextMeshProUGUI, FadeString));
|
|
}
|
|
|
|
public void Start()
|
|
{
|
|
Next_Btn.onClick.AddListener(() =>
|
|
{
|
|
|
|
});
|
|
}
|
|
|
|
public void HidePanel()
|
|
{
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// ´ò×Ö»ú
|
|
/// </summary>
|
|
/// <param name="text"></param>
|
|
/// <param name="a"></param>
|
|
/// <returns></returns>
|
|
public IEnumerator Typing(TextMeshProUGUI text ,string a)
|
|
{
|
|
yield return new WaitForSeconds(1f);
|
|
text.text = string.Empty;
|
|
string strTemp = string.Empty;
|
|
for (int i = 0; i < a.Length; i++)
|
|
{
|
|
yield return new WaitForSeconds(typeTime);
|
|
strTemp += a[i];
|
|
text.text = strTemp;
|
|
}
|
|
}
|
|
}
|